浏览代码

Fixed JSON parser to correctly convert u0000 to the Unicode representation.

grunfink 1 月之前
父节点
当前提交
ec2c5c2046
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      xs_json.h

+ 1 - 1
xs_json.h

@@ -281,7 +281,7 @@ static xs_val *_xs_json_load_lexer(FILE *f, js_type *t)
                     }
 
                     /* replace dangerous control codes with their visual representations */
-                    if (cp < ' ' && !strchr("\r\n\t", cp))
+                    if (cp == 0 || (cp < ' ' && !strchr("\r\n\t", cp)))
                         cp += 0x2400;
 
                     break;