From 02e9c048d0183ac9e39394485e9bf843de946177 Mon Sep 17 00:00:00 2001 From: Philipp Schafft Date: Wed, 7 Oct 2020 20:19:52 +0000 Subject: [PATCH] Fix: Handle bytes >= 0x80 correctly --- src/json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/json.c b/src/json.c index 7a001b9c..c5fdf9ff 100644 --- a/src/json.c +++ b/src/json.c @@ -290,7 +290,7 @@ static void write_string(json_renderer_t *renderer, const char *string, unsigned return; } - if (*string < 0x20) { + if (((unsigned char)*string) < 0x20) { char buf[7]; snprintf(buf, sizeof(buf), "\\u%.4x", (unsigned int)*string); write_raw(renderer, buf, 0);