Skip to content

Commit 0cc1db6

Browse files
committed
Change the format used for sprintbuf (but not scanf) to use %f instead of %lf because the "l" is unnecessary and some compilers behave differently with it present (e.g. MinGW).
Thanks for Mateusz Loskot for the fix.
1 parent 31faa49 commit 0cc1db6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

json_object.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ static int json_object_double_to_json_string(struct json_object* jso,
463463
int level,
464464
int flags)
465465
{
466-
return sprintbuf(pb, "%lf", jso->o.c_double);
466+
return sprintbuf(pb, "%f", jso->o.c_double);
467467
}
468468

469469
struct json_object* json_object_new_double(double d)

0 commit comments

Comments
 (0)