Fix parsing doubles for mingw

This commit is contained in:
topilski
2017-07-30 07:30:05 +03:00
parent af87944585
commit 65884f4d9e

View File

@@ -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;
}
/*