diff --git a/jsmn.c b/jsmn.c index e22d8a3..412c3c2 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 */