提交 dc4b6291 编写于 作者: M Max Bruckner

fix #10, now failing on incorrect escape sequences

上级 afd690d1
...@@ -534,6 +534,11 @@ static const char *parse_string(cJSON *item, const char *str, const char **ep) ...@@ -534,6 +534,11 @@ static const char *parse_string(cJSON *item, const char *str, const char **ep)
case 't': case 't':
*ptr2++ = '\t'; *ptr2++ = '\t';
break; break;
case '\"':
case '\\':
case '/':
*ptr2++ = *ptr;
break;
case 'u': case 'u':
/* transcode utf16 to utf8. See RFC2781 and RFC3629. */ /* transcode utf16 to utf8. See RFC2781 and RFC3629. */
uc = parse_hex4(ptr + 1); /* get the unicode char. */ uc = parse_hex4(ptr + 1); /* get the unicode char. */
...@@ -620,8 +625,8 @@ static const char *parse_string(cJSON *item, const char *str, const char **ep) ...@@ -620,8 +625,8 @@ static const char *parse_string(cJSON *item, const char *str, const char **ep)
ptr2 += len; ptr2 += len;
break; break;
default: default:
*ptr2++ = *ptr; *ep = str;
break; return 0;
} }
ptr++; ptr++;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册