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)
/* this code-path optimizes a bit, for when we reference the 0-9 index range in a JSON array
and because leading zeros not allowed */
if (len == 1) {
- if (isdigit((int)path[0])) {
+ if (isdigit((unsigned char)path[0])) {
*idx = (path[0] - '0');
goto check_oob;
}
}
/* RFC states base-10 decimals */
for (i = 0; i < len; i++) {
- if (!isdigit((int)path[i])) {
+ if (!isdigit((unsigned char)path[i])) {
errno = EINVAL;
return 0;
}
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;
}