diff options
author | corvid <corvid@lavabit.com> | 2012-12-30 22:02:53 +0000 |
---|---|---|
committer | corvid <corvid@lavabit.com> | 2012-12-30 22:02:53 +0000 |
commit | cb711a5a7e2aa24c84128781bbf02ec8bf211f17 (patch) | |
tree | 3eb6f7d794e2fd1f61e5b92dd858ab98a4950819 /src | |
parent | 5289046648eb60b9c362e418da09f2cb7d18b1a2 (diff) |
a_Color_parse: err val 2 requires successful parsing of 0[xX]...
Diffstat (limited to 'src')
-rw-r--r-- | src/colors.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/colors.c b/src/colors.c index be4cb306..264c7357 100644 --- a/src/colors.c +++ b/src/colors.c @@ -246,7 +246,7 @@ static int32_t Color_parse_hex (const char *s, int32_t default_color, int *err) * 0 if a color beginning with '#' is successfully parsed * or the color is a recognized word. * 1 if the color is bare hex or can't be parsed at all. - * 2 if a color begins with 0[xX]. + * 2 if a color beginning with 0[xX] is successfully parsed. */ int32_t a_Color_parse (const char *subtag, int32_t default_color, int *err) { @@ -263,8 +263,8 @@ int32_t a_Color_parse (const char *subtag, int32_t default_color, int *err) } else if (*cp == '0' && (cp[1] == 'x' || cp[1] == 'X') ) { ret_color = Color_parse_hex(cp + 2, default_color, &st); - st = 2; - + if (!st) + st = 2; } else { /* Binary search */ low = 0; |