aboutsummaryrefslogtreecommitdiffstats
path: root/src/protocol/ArgParser.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2015-08-11 22:57:47 +0200
committerMax Kellermann <max@duempel.org>2015-08-11 22:57:47 +0200
commitee61dfe08742b76b1c637a038dd5b3a6b244ece7 (patch)
tree08d5dcded4f95edf98fa74236cd296dc93795f91 /src/protocol/ArgParser.hxx
parent9231f420c199a7c12cb8aad17bcca80a0aaca6ad (diff)
downloadmpd-ee61dfe08742b76b1c637a038dd5b3a6b244ece7.tar.gz
mpd-ee61dfe08742b76b1c637a038dd5b3a6b244ece7.tar.xz
mpd-ee61dfe08742b76b1c637a038dd5b3a6b244ece7.zip
protocol/ArgParser: use std::numeric_limits
Using unsigned(-1) renders undefined behavior.
Diffstat (limited to 'src/protocol/ArgParser.hxx')
-rw-r--r--src/protocol/ArgParser.hxx4
1 files changed, 3 insertions, 1 deletions
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();
}
};