command: omitting the range end is possible
When the range end is missing, then the maximum possible value is assumed.
This commit is contained in:
@@ -221,7 +221,7 @@ check_range(struct client *client, unsigned *value_r1, unsigned *value_r2,
|
||||
|
||||
if (*test == ':') {
|
||||
value = strtol(++test, &test2, 10);
|
||||
if (*test2 != '\0' || test == test2) {
|
||||
if (*test2 != '\0') {
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
command_error_v(client, ACK_ERROR_ARG, fmt, args);
|
||||
@@ -229,6 +229,9 @@ check_range(struct client *client, unsigned *value_r1, unsigned *value_r2,
|
||||
return false;
|
||||
}
|
||||
|
||||
if (test == test2)
|
||||
value = G_MAXUINT;
|
||||
|
||||
if (value < 0) {
|
||||
command_error(client, ACK_ERROR_ARG,
|
||||
"Number is negative: %s", s);
|
||||
|
Reference in New Issue
Block a user