diff --git a/json_object.c b/json_object.c index 2971f08..458163c 100644 --- a/json_object.c +++ b/json_object.c @@ -806,6 +806,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) { @@ -830,7 +831,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;