Browse Source

Eliminate static qualifiers on a couple local variables that were causing thread safety issues. Suggested by @rouault in PR #331.

tags/json-c-0.13-20171207
Eric Haszlakiewicz 8 years ago
parent
commit
55ecae3e58
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      json_object.c

+ 2
- 2
json_object.c View File

@@ -147,7 +147,7 @@ static int json_escape_str(struct printbuf *pb, const char *str, int len, int fl
printbuf_memappend(pb, printbuf_memappend(pb,
str + start_offset, str + start_offset,
pos - start_offset); pos - start_offset);
static char sbuf[7];
char sbuf[7];
snprintf(sbuf, sizeof(sbuf), snprintf(sbuf, sizeof(sbuf),
"\\u00%c%c", "\\u00%c%c",
json_hex_chars[c >> 4], json_hex_chars[c >> 4],
@@ -589,7 +589,7 @@ static int json_object_int_to_json_string(struct json_object* jso,
int flags) int flags)
{ {
/* room for 19 digits, the sign char, and a null term */ /* 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); snprintf(sbuf, sizeof(sbuf), "%" PRId64, jso->o.c_int64);
return printbuf_memappend (pb, sbuf, strlen(sbuf)); return printbuf_memappend (pb, sbuf, strlen(sbuf));
} }


Loading…
Cancel
Save