protocol/ArgParser: use std::numeric_limits
Using unsigned(-1) renders undefined behavior.
This commit is contained in:
parent
9231f420c1
commit
ee61dfe087
@ -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
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user