Commit 1532ffe2 authored by Max Kellermann's avatar Max Kellermann

protocol/ArgParser: fix range check

The old check unsigned(value) > std::numeric_limits<unsigned>::max() .. cannot ever fail.
parent b24cbc68
......@@ -92,7 +92,7 @@ check_range(Client &client, unsigned *value_r1, unsigned *value_r2,
return false;
}
if (unsigned(value) > std::numeric_limits<unsigned>::max()) {
if (value > std::numeric_limits<int>::max()) {
command_error(client, ACK_ERROR_ARG,
"Number too large: %s", s);
return false;
......@@ -117,7 +117,7 @@ check_range(Client &client, unsigned *value_r1, unsigned *value_r2,
return false;
}
if (unsigned(value) > std::numeric_limits<unsigned>::max()) {
if (value > std::numeric_limits<int>::max()) {
command_error(client, ACK_ERROR_ARG,
"Number too large: %s", s);
return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment