]> granicus.if.org Git - json-c/commitdiff
Change the format used for sprintbuf (but not scanf) to use %f instead of %lf because...
authorEric Haszlakiewicz <erh+git@nimenees.com>
Sun, 29 Apr 2012 16:04:33 +0000 (11:04 -0500)
committerEric Haszlakiewicz <erh+git@nimenees.com>
Sun, 29 Apr 2012 16:04:33 +0000 (11:04 -0500)
Thanks for Mateusz Loskot for the fix.

json_object.c

index 825630fc3b51369ad8192fe8cff1a7181d3ca147..5a359381d9acda84f324b1497e5b94806d77c7af 100644 (file)
@@ -463,7 +463,7 @@ static int json_object_double_to_json_string(struct json_object* jso,
                                             int level,
                                                 int flags)
 {
-  return sprintbuf(pb, "%lf", jso->o.c_double);
+  return sprintbuf(pb, "%f", jso->o.c_double);
 }
 
 struct json_object* json_object_new_double(double d)