Issue #407: fix incorrect casts in calls to ctype functions (isdigit and isspace) so we don't crash when asserts are enabled on certain platforms and characters > 128 are parsed.

This commit is contained in:
Eric Haszlakiewicz committed 2018-03-25 18:25:58 -04:00
1 parent da4b34355d
commit f8c632f579
3 files changed
+4 -4

No files matched your search

+1 -1
View File
@@ -295,7 +295,7 @@ struct json_object* json_tokener_parse_ex(struct json_tokener *tok,
case json_tokener_state_eatws:
/* Advance until we change state */
while (isspace((int)c)) {
while (isspace((unsigned char)c)) {
if ((!ADVANCE_CHAR(str, tok)) || (!PEEK_CHAR(c, tok)))
goto out;
}