mirror of
https://github.com/json-c/json-c.git
synced 2026-04-11 08:19:08 +08:00
float parsing must be locale independent
This commit is contained in:
@@ -585,7 +585,7 @@ struct json_object* json_tokener_parse_ex(struct json_tokener *tok,
|
||||
double numd;
|
||||
if (!tok->is_double && json_parse_int64(tok->pb->buf, &num64) == 0) {
|
||||
current = json_object_new_int64(num64);
|
||||
} else if(tok->is_double && sscanf(tok->pb->buf, "%lf", &numd) == 1) {
|
||||
} else if(tok->is_double && json_parse_double(tok->pb->buf, &numd) == 0) {
|
||||
current = json_object_new_double(numd);
|
||||
} else {
|
||||
tok->err = json_tokener_error_parse_number;
|
||||
|
||||
Reference in New Issue
Block a user