From: Eric Haszlakiewicz Date: Sun, 9 Jul 2017 21:56:18 +0000 (-0700) Subject: Eliminate static qualifiers on a couple local variables that were causing thread... X-Git-Tag: json-c-0.13-20171207~80 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=55ecae3e5866a2f14aee737649b3c2cf392051b3;p=thirdparty%2Fjson-c.git Eliminate static qualifiers on a couple local variables that were causing thread safety issues. Suggested by @rouault in PR #331. --- diff --git a/json_object.c b/json_object.c index fb8fba49..3f6298e2 100644 --- a/json_object.c +++ b/json_object.c @@ -147,7 +147,7 @@ static int json_escape_str(struct printbuf *pb, const char *str, int len, int fl printbuf_memappend(pb, str + start_offset, pos - start_offset); - static char sbuf[7]; + char sbuf[7]; snprintf(sbuf, sizeof(sbuf), "\\u00%c%c", json_hex_chars[c >> 4], @@ -589,7 +589,7 @@ static int json_object_int_to_json_string(struct json_object* jso, int flags) { /* room for 19 digits, the sign char, and a null term */ - static char sbuf[21]; + char sbuf[21]; snprintf(sbuf, sizeof(sbuf), "%" PRId64, jso->o.c_int64); return printbuf_memappend (pb, sbuf, strlen(sbuf)); }