diff options
author | Max Kellermann <max@duempel.org> | 2015-08-11 22:57:47 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2015-08-11 22:57:47 +0200 |
commit | ee61dfe08742b76b1c637a038dd5b3a6b244ece7 (patch) | |
tree | 08d5dcded4f95edf98fa74236cd296dc93795f91 | |
parent | 9231f420c199a7c12cb8aad17bcca80a0aaca6ad (diff) | |
download | mpd-ee61dfe08742b76b1c637a038dd5b3a6b244ece7.tar.gz mpd-ee61dfe08742b76b1c637a038dd5b3a6b244ece7.tar.xz mpd-ee61dfe08742b76b1c637a038dd5b3a6b244ece7.zip |
protocol/ArgParser: use std::numeric_limits
Using unsigned(-1) renders undefined behavior.
-rw-r--r-- | src/protocol/ArgParser.cxx | 2 | ||||
-rw-r--r-- | src/protocol/ArgParser.hxx | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/protocol/ArgParser.cxx b/src/protocol/ArgParser.cxx index 2c3e21f79..1dbbd0cf3 100644 --- a/src/protocol/ArgParser.cxx +++ b/src/protocol/ArgParser.cxx @@ -22,8 +22,6 @@ #include "Result.hxx" #include "Chrono.hxx" -#include <limits> - #include <stdlib.h> bool diff --git a/src/protocol/ArgParser.hxx b/src/protocol/ArgParser.hxx index d71894771..221ffebe3 100644 --- a/src/protocol/ArgParser.hxx +++ b/src/protocol/ArgParser.hxx @@ -22,6 +22,8 @@ #include "check.h" +#include <limits> + #include <stdint.h> class Client; @@ -39,7 +41,7 @@ struct RangeArg { void SetAll() { start = 0; - end = unsigned(-1); + end = std::numeric_limits<unsigned>::max(); } }; |