Added a couple of casts to quiet the compiler.

No need to test isascii(c) before isdigit(c) or isxdigit(c).
This commit is contained in:
softins 2004-07-27 14:43:58 +00:00
parent 7c427a4dce
commit 1da6c35a6d

View File

@ -232,12 +232,12 @@ inet_chksum_pbuf(struct pbuf *p)
base = 8;
}
for (;;) {
if (isascii(c) && isdigit(c)) {
val = (val * base) + (c - '0');
if (isdigit(c)) {
val = (val * base) + (int)(c - '0');
c = *++cp;
} else if (base == 16 && isascii(c) && isxdigit(c)) {
} else if (base == 16 && isxdigit(c)) {
val = (val << 4) |
(c + 10 - (islower(c) ? 'a' : 'A'));
(int)(c + 10 - (islower(c) ? 'a' : 'A'));
c = *++cp;
} else
break;