|
|
@@ -73,6 +73,16 @@ static int is_hex_char(char c) |
|
|
|
|| (c >= 'a' && c <= 'f'); |
|
|
|
} |
|
|
|
|
|
|
|
static int is_number_char(char c) |
|
|
|
{ |
|
|
|
return (c >= '0' && c <= '9') |
|
|
|
|| c == '.' |
|
|
|
|| c == '+' |
|
|
|
|| c == '-' |
|
|
|
|| c == 'e' |
|
|
|
|| c == 'E'; |
|
|
|
} |
|
|
|
|
|
|
|
/* Use C99 NAN by default; if not available, nan("") should work too. */ |
|
|
|
#ifndef NAN |
|
|
|
#define NAN nan("") |
|
|
@@ -757,7 +767,7 @@ struct json_object* json_tokener_parse_ex(struct json_tokener *tok, |
|
|
|
int case_len=0; |
|
|
|
int is_exponent=0; |
|
|
|
int negativesign_next_possible_location=1; |
|
|
|
while(c && strchr(json_number_chars, c)) { |
|
|
|
while(c && is_number_char(c)) { |
|
|
|
++case_len; |
|
|
|
|
|
|
|
/* non-digit characters checks */ |
|
|
|