From d31a04f4856ba8b68fc1b04ff7d12352056c87bd Mon Sep 17 00:00:00 2001 From: Mark Barfield Date: Thu, 15 Mar 2012 16:46:00 +0000 Subject: [PATCH] Fix small parsing problems with uppercase characters for hex and sci-notation numbers. --- json_object.c | 2 +- json_tokener.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/json_object.c b/json_object.c index fc52f5c..1515c2f 100644 --- a/json_object.c +++ b/json_object.c @@ -32,7 +32,7 @@ /* #define REFCOUNT_DEBUG 1 */ const char *json_number_chars = "0123456789.+-eE"; -const char *json_hex_chars = "0123456789abcdef"; +const char *json_hex_chars = "0123456789abcdefABCDEF"; static void json_object_generic_delete(struct json_object* jso); static struct json_object* json_object_new(enum json_type o_type); diff --git a/json_tokener.c b/json_tokener.c index df106b1..13d5acf 100644 --- a/json_tokener.c +++ b/json_tokener.c @@ -550,7 +550,7 @@ struct json_object* json_tokener_parse_ex(struct json_tokener *tok, int case_len=0; while(c && strchr(json_number_chars, c)) { ++case_len; - if(c == '.' || c == 'e') tok->is_double = 1; + if(c == '.' || c == 'e' || c == 'E') tok->is_double = 1; if (!ADVANCE_CHAR(str, tok) || !POP_CHAR(c, tok)) { printbuf_memappend_fast(tok->pb, case_start, case_len); goto out;