提交 85bb89a8 编写于 作者: D David Corbett 提交者: Behdad Esfahbod

Fix string matching in parse_bool

上级 0fd89dc6
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册