mirror of
https://github.com/json-c/json-c.git
synced 2026-03-30 10:29:06 +08:00
Fix incremental parsing of invalid numbers with exponents, such as "0e+-" and "12.3E12E12", while still allowing "0e+" in non-strict mode.
Deprecate the json_parse_double() function from json_util.h
This commit is contained in:
@@ -222,6 +222,7 @@ int json_object_to_file(const char *filename, struct json_object *obj)
|
||||
return json_object_to_file_ext(filename, obj, JSON_C_TO_STRING_PLAIN);
|
||||
}
|
||||
|
||||
// Deprecated json_parse_double function. See json_tokener_parse_double instead.
|
||||
int json_parse_double(const char *buf, double *retval)
|
||||
{
|
||||
char *end;
|
||||
@@ -250,7 +251,7 @@ int json_parse_uint64(const char *buf, uint64_t *retval)
|
||||
while (*buf == ' ')
|
||||
buf++;
|
||||
if (*buf == '-')
|
||||
return 1; /* error: uint cannot be negative */
|
||||
return 1; /* error: uint cannot be negative */
|
||||
|
||||
val = strtoull(buf, &end, 10);
|
||||
if (end != buf)
|
||||
|
||||
Reference in New Issue
Block a user