mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-28 17:19:17 +01:00
Fix string matching in parse_bool
This commit is contained in:
1 parent
0fd89dc61c
commit
85bb89a88b
1 file changed
+2
-2
+2
-2
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user