both numbers to know that they have the same magnitude, so we
remember it in BIAS. */
for(;; (*a)++, (*b)++) {
- if ((*a == aend || !isdigit((int)**a)) &&
- (*b == bend || !isdigit((int)**b)))
+ if ((*a == aend || !isdigit((int)(unsigned char)**a)) &&
+ (*b == bend || !isdigit((int)(unsigned char)**b)))
return bias;
- else if (*a == aend || !isdigit((int)**a))
+ else if (*a == aend || !isdigit((int)(unsigned char)**a))
return -1;
- else if (*b == bend || !isdigit((int)**b))
+ else if (*b == bend || !isdigit((int)(unsigned char)**b))
return +1;
else if (**a < **b) {
if (!bias)
/* Compare two left-aligned numbers: the first to have a
different value wins. */
for(;; (*a)++, (*b)++) {
- if ((*a == aend || !isdigit((int)**a)) &&
- (*b == bend || !isdigit((int)**b)))
+ if ((*a == aend || !isdigit((int)(unsigned char)**a)) &&
+ (*b == bend || !isdigit((int)(unsigned char)**b)))
return 0;
- else if (*a == aend || !isdigit((int)**a))
+ else if (*a == aend || !isdigit((int)(unsigned char)**a))
return -1;
- else if (*b == bend || !isdigit((int)**b))
+ else if (*b == bend || !isdigit((int)(unsigned char)**b))
return +1;
else if (**a < **b)
return -1;
ca = *ap; cb = *bp;
/* skip over leading spaces or zeros */
- while (isspace((int)ca))
+ while (isspace((int)(unsigned char)ca))
ca = *++ap;
- while (isspace((int)cb))
+ while (isspace((int)(unsigned char)cb))
cb = *++bp;
/* process run of digits */
- if (isdigit((int)ca) && isdigit((int)cb)) {
+ if (isdigit((int)(unsigned char)ca) && isdigit((int)(unsigned char)cb)) {
fractional = (ca == '0' || cb == '0');
if (fractional)
}
if (fold_case) {
- ca = toupper(ca);
- cb = toupper(cb);
+ ca = toupper((int)(unsigned char)ca);
+ cb = toupper((int)(unsigned char)cb);
}
if (ca < cb)