From 85bb89a88bdfae02fb7c27c7b994f4f22723442a Mon Sep 17 00:00:00 2001 From: David Corbett Date: Mon, 4 Dec 2017 15:15:27 -0500 Subject: [PATCH] Fix string matching in parse_bool --- src/hb-common.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hb-common.cc b/src/hb-common.cc index 92720d9e7..cb1fb43ff 100644 --- a/src/hb-common.cc +++ b/src/hb-common.cc @@ -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;