|
|
@ -113,8 +113,8 @@ static jsmnerr_t jsmn_parse_string(jsmn_parser *parser, const char *js,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Backslash: Quoted symbol expected */
|
|
|
|
/* Backslash: Quoted symbol expected */
|
|
|
|
if (c == '\\') {
|
|
|
|
if (c == '\\' && parser->pos + 1 < len) {
|
|
|
|
int i = 0;
|
|
|
|
int i;
|
|
|
|
parser->pos++;
|
|
|
|
parser->pos++;
|
|
|
|
switch (js[parser->pos]) {
|
|
|
|
switch (js[parser->pos]) {
|
|
|
|
/* Allowed escaped symbols */
|
|
|
|
/* Allowed escaped symbols */
|
|
|
@ -124,7 +124,7 @@ static jsmnerr_t jsmn_parse_string(jsmn_parser *parser, const char *js,
|
|
|
|
/* Allows escaped symbol \uXXXX */
|
|
|
|
/* Allows escaped symbol \uXXXX */
|
|
|
|
case 'u':
|
|
|
|
case 'u':
|
|
|
|
parser->pos++;
|
|
|
|
parser->pos++;
|
|
|
|
for(; i < 4 && js[parser->pos] != '\0'; i++) {
|
|
|
|
for(i = 0; i < 4 && parser->pos < len && js[parser->pos] != '\0'; i++) {
|
|
|
|
/* If it isn't a hex character we have an error */
|
|
|
|
/* If it isn't a hex character we have an error */
|
|
|
|
if(!((js[parser->pos] >= 48 && js[parser->pos] <= 57) || /* 0-9 */
|
|
|
|
if(!((js[parser->pos] >= 48 && js[parser->pos] <= 57) || /* 0-9 */
|
|
|
|
(js[parser->pos] >= 65 && js[parser->pos] <= 70) || /* A-F */
|
|
|
|
(js[parser->pos] >= 65 && js[parser->pos] <= 70) || /* A-F */
|
|
|
|