소스 검색

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;