From dded75175796d70b8defbd9c6e5cf4f77d53add6 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Mon, 6 Feb 2017 23:06:00 +0100 Subject: [PATCH] parse_string: remove useless first byte marks for utf8 --- cJSON.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cJSON.c b/cJSON.c index e0c1b57..c53f10e 100644 --- a/cJSON.c +++ b/cJSON.c @@ -396,15 +396,13 @@ static unsigned parse_hex4(const unsigned char *str) } /* first bytes of UTF8 encoding for a given length in bytes */ -static const unsigned char firstByteMark[7] = +static const unsigned char firstByteMark[5] = { 0x00, /* should never happen */ 0x00, /* 0xxxxxxx */ 0xC0, /* 110xxxxx */ 0xE0, /* 1110xxxx */ - 0xF0, /* 11110xxx */ - 0xF8, - 0xFC + 0xF0 /* 11110xxx */ }; /* Parse the input text into an unescaped cstring, and populate item. */