command: fix boolean value parser

Due to a logic error, no value was valid for the boolean value
parser.  Replace "||" with "&&".
This commit is contained in:
Max Kellermann 2008-10-23 18:06:05 +02:00
parent 2cc2420f8c
commit 098991f8e8
1 changed files with 1 additions and 1 deletions

View File

@ -186,7 +186,7 @@ check_bool(struct client *client, bool *value_r, const char *s)
char *endptr;
value = strtol(s, &endptr, 10);
if (*endptr != 0 || value != 0 || value != 1) {
if (*endptr != 0 || (value != 0 && value != 1)) {
command_error(client, ACK_ERROR_ARG,
"Boolean (0/1) expected: %s", s);
return false;