]> git.ipfire.org Git - thirdparty/json-c.git/commitdiff
PR#394: fix breakage with VS build.
authorEric Haszlakiewicz <erh+git@nimenees.com>
Sun, 24 Dec 2017 19:42:58 +0000 (14:42 -0500)
committerEric Haszlakiewicz <erh+git@nimenees.com>
Sun, 24 Dec 2017 19:42:58 +0000 (14:42 -0500)
json_object.c

index 52e8b76a7c59d37a6f8c0b99fc3ac0ec0c8f7f81..8287163a1c1d2eb5812b397e2b88459c12348c30 100644 (file)
@@ -809,6 +809,7 @@ static int json_object_double_to_json_string_format(struct json_object* jso,
        else
        {
                const char *std_format = "%.17g";
+               int format_drops_decimals = 0;
 
                if (!format)
                {
@@ -833,7 +834,6 @@ static int json_object_double_to_json_string_format(struct json_object* jso,
                else
                        p = strchr(buf, '.');
 
-               int format_drops_decimals = 0;
                if (format == std_format || strstr(format, ".0f") == NULL)
                        format_drops_decimals = 1;