From: Eric Haszlakiewicz Date: Sun, 9 Jul 2017 23:08:29 +0000 (-0700) Subject: Move a variable declaration to the start of the block to work better with older compi... X-Git-Tag: json-c-0.13-20171207~74 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b64402ede2043d3bdc96291e4f990007edbf0832;p=thirdparty%2Fjson-c.git Move a variable declaration to the start of the block to work better with older compilers. --- diff --git a/json_object.c b/json_object.c index bd65daf6..ddc96bc1 100644 --- a/json_object.c +++ b/json_object.c @@ -143,11 +143,11 @@ static int json_escape_str(struct printbuf *pb, const char *str, int len, int fl default: if(c < ' ') { + char sbuf[7]; if(pos - start_offset > 0) printbuf_memappend(pb, str + start_offset, pos - start_offset); - char sbuf[7]; snprintf(sbuf, sizeof(sbuf), "\\u00%c%c", json_hex_chars[c >> 4],