Fix string matching in parse_bool
This commit is contained in:
parent
0fd89dc61c
commit
85bb89a88b
|
@ -784,9 +784,9 @@ parse_bool (const char **pp, const char *end, uint32_t *pv)
|
|||
(*pp)++;
|
||||
|
||||
/* CSS allows on/off as aliases 1/0. */
|
||||
if (*pp - p == 2 || 0 == strncmp (p, "on", 2))
|
||||
if (*pp - p == 2 && 0 == strncmp (p, "on", 2))
|
||||
*pv = 1;
|
||||
else if (*pp - p == 3 || 0 == strncmp (p, "off", 2))
|
||||
else if (*pp - p == 3 && 0 == strncmp (p, "off", 3))
|
||||
*pv = 0;
|
||||
else
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue