Skip to content

Commit 11a80f3

Browse files
author
James McLaughlin
committed
Add cast to unsigned char when checking for UTF-8 BOM
1 parent 63c9a78 commit 11a80f3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

json.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,9 @@ json_value * json_parse_ex (json_settings * settings,
222222

223223
/* Skip UTF-8 BOM
224224
*/
225-
if (length >= 3 && json [0] == 0xEF
226-
&& json [1] == 0xBB
227-
&& json [2] == 0xBF)
225+
if (length >= 3 && ((unsigned char) json [0]) == 0xEF
226+
&& ((unsigned char) json [1]) == 0xBB
227+
&& ((unsigned char) json [2]) == 0xBF)
228228
{
229229
json += 3;
230230
length -= 3;

0 commit comments

Comments
 (0)