diff options
-rw-r--r-- | src/dump.c | 2 | ||||
-rw-r--r-- | src/load.c | 4 |
2 files changed, 3 insertions, 3 deletions
@@ -70,7 +70,7 @@ static int dump_string(const char *str, dump_func dump, void *data) char seq[7]; int length; - while(*end && *end != '\\' && *end != '"' && (*end < 0 || *end > 0x1F)) + while(*end && *end != '\\' && *end != '"' && (unsigned char)*end > 0x1F) end++; if(end != str) { @@ -135,7 +135,7 @@ static char stream_get(stream_t *stream, json_error_t *error) c = stream->buffer[0]; - if(c < 0 && c != EOF) + if((unsigned char)c >= 0x80 && c != (char)EOF) { /* multi-byte UTF-8 sequence */ int i, count; @@ -519,7 +519,7 @@ static int lex_scan(lex_t *lex, json_error_t *error) c = lex_get(lex, error); } - if(c == EOF) { + if(c == (char)EOF) { if(lex_eof(lex)) lex->token = TOKEN_EOF; else |