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
2018-03-25 18:25:58 -04:00
parent da4b34355d
commit f8c632f579
3 changed files with 4 additions and 4 deletions

View File

@@ -838,7 +838,7 @@ static int json_object_double_to_json_string_format(struct json_object* jso,
format_drops_decimals = 1;
if (size < (int)sizeof(buf) - 2 &&
isdigit((int)buf[0]) && /* Looks like *some* kind of number */
isdigit((unsigned char)buf[0]) && /* Looks like *some* kind of number */
!p && /* Has no decimal point */
strchr(buf, 'e') == NULL && /* Not scientific notation */
format_drops_decimals)