protocol/ArgParser: use std::numeric_limits

Using unsigned(-1) renders undefined behavior.
This commit is contained in:
Max Kellermann 2015-08-11 22:57:47 +02:00
parent 9231f420c1
commit ee61dfe087
2 changed files with 3 additions and 3 deletions

View File

@ -22,8 +22,6 @@
#include "Result.hxx" #include "Result.hxx"
#include "Chrono.hxx" #include "Chrono.hxx"
#include <limits>
#include <stdlib.h> #include <stdlib.h>
bool bool

View File

@ -22,6 +22,8 @@
#include "check.h" #include "check.h"
#include <limits>
#include <stdint.h> #include <stdint.h>
class Client; class Client;
@ -39,7 +41,7 @@ struct RangeArg {
void SetAll() { void SetAll() {
start = 0; start = 0;
end = unsigned(-1); end = std::numeric_limits<unsigned>::max();
} }
}; };