From: topilski Date: Sun, 30 Jul 2017 04:30:05 +0000 (+0300) Subject: Fix parsing doubles for mingw X-Git-Tag: json-c-0.13-20171207~65^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=65884f4d9e619fc797e273a338e2391442cca9f6;p=thirdparty%2Fjson-c.git Fix parsing doubles for mingw --- diff --git a/json_util.c b/json_util.c index 3a717b79..cc57e34f 100644 --- a/json_util.c +++ b/json_util.c @@ -195,7 +195,9 @@ int json_object_to_file(const char *filename, struct json_object *obj) int json_parse_double(const char *buf, double *retval) { - return (sscanf(buf, "%lf", retval)==1 ? 0 : 1); + char *end; + *retval = strtod(buf, &end); + return end == buf ? 1 : 0; } /*