@@ -337,7 +337,6 @@ struct json_object* json_tokener_parse_ex(struct json_tokener *tok, | |||||
state = json_tokener_state_number; | state = json_tokener_state_number; | ||||
printbuf_reset(tok->pb); | printbuf_reset(tok->pb); | ||||
tok->is_double = 0; | tok->is_double = 0; | ||||
tok->st_pos = 0; | |||||
goto redo_char; | goto redo_char; | ||||
default: | default: | ||||
tok->err = json_tokener_error_parse_unexpected; | tok->err = json_tokener_error_parse_unexpected; | ||||
@@ -686,6 +685,7 @@ struct json_object* json_tokener_parse_ex(struct json_tokener *tok, | |||||
(c == 'i' || c == 'I')) | (c == 'i' || c == 'I')) | ||||
{ | { | ||||
state = json_tokener_state_inf; | state = json_tokener_state_inf; | ||||
tok->st_pos = 0; | |||||
goto redo_char; | goto redo_char; | ||||
} | } | ||||
} | } | ||||
@@ -79,6 +79,10 @@ static void test_basic_parse() | |||||
printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj)); | printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj)); | ||||
json_object_put(new_obj); | json_object_put(new_obj); | ||||
new_obj = json_tokener_parse("{ \"min\": Infinity, \"max\": -Infinity}"); | |||||
printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj)); | |||||
json_object_put(new_obj); | |||||
new_obj = json_tokener_parse("True"); | new_obj = json_tokener_parse("True"); | ||||
printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj)); | printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj)); | ||||
json_object_put(new_obj); | json_object_put(new_obj); | ||||
@@ -11,6 +11,7 @@ new_obj.to_string()=Infinity | |||||
new_obj.to_string()=Infinity | new_obj.to_string()=Infinity | ||||
new_obj.to_string()=-Infinity | new_obj.to_string()=-Infinity | ||||
new_obj.to_string()=-Infinity | new_obj.to_string()=-Infinity | ||||
new_obj.to_string()={ "min": Infinity, "max": -Infinity } | |||||
new_obj.to_string()=true | new_obj.to_string()=true | ||||
new_obj.to_string()=12 | new_obj.to_string()=12 | ||||
new_obj.to_string()=12.3 | new_obj.to_string()=12.3 | ||||