summaryrefslogtreecommitdiff
path: root/jsmn.c
diff options
context:
space:
mode:
authorSerge A. Zaitsev <zaitsev.serge@gmail.com>2014-11-17 15:06:12 +0200
committerSerge A. Zaitsev <zaitsev.serge@gmail.com>2014-11-17 15:06:12 +0200
commit946a2b1e02665a6c0235ba26c432cf09fe598cce (patch)
treebecd7d0c2d2712f16031982fb851258452ff3a6b /jsmn.c
parenta0e2b876cacf1dae415dd331e0589b1832ae2052 (diff)
moved i declaration to the top of the block, issue #38 fixed
Diffstat (limited to 'jsmn.c')
-rw-r--r--jsmn.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/jsmn.c b/jsmn.c
index e22d8a3c9..412c3c251 100644
--- a/jsmn.c
+++ b/jsmn.c
@@ -114,6 +114,7 @@ static jsmnerr_t jsmn_parse_string(jsmn_parser *parser, const char *js,
/* Backslash: Quoted symbol expected */
if (c == '\\') {
+ int i = 0;
parser->pos++;
switch (js[parser->pos]) {
/* Allowed escaped symbols */
@@ -123,7 +124,6 @@ static jsmnerr_t jsmn_parse_string(jsmn_parser *parser, const char *js,
/* Allows escaped symbol \uXXXX */
case 'u':
parser->pos++;
- int i = 0;
for(; i < 4 && js[parser->pos] != '\0'; i++) {
/* If it isn't a hex character we have an error */
if(!((js[parser->pos] >= 48 && js[parser->pos] <= 57) || /* 0-9 */