diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2000-08-07 23:05:43 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2000-08-07 23:05:43 +0000 |
commit | 12c5099362d0d4bde72edcd88958da4a837c91b8 (patch) | |
tree | 28a6896fe3974a7553cea11744bff871cabc745a /snprintf.c | |
parent | 0caf6a62410d143b687157196004b864e4374c3d (diff) |
Cast arguments to "isxdigit()", "isdigit()", and "isflag()" to "unsigned
char" so that if it has the 8th bit set it won't get sign-extended; this
squelches a GCC complaint.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2223 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'snprintf.c')
-rw-r--r-- | snprintf.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/snprintf.c b/snprintf.c index 13cc4a3047..0bd8aa95ac 100644 --- a/snprintf.c +++ b/snprintf.c @@ -201,7 +201,7 @@ char ** fract; fp = integral(number, &ip); ch = (int)((fp + PRECISION)*base); /* force to round */ integral_part[i] = (ch <= 9) ? ch + '0' : ch + 'a' - 10; - if (! isxdigit(integral_part[i])) /* bail out overflow !! */ + if (! isxdigit((unsigned char)integral_part[i])) /* bail out overflow !! */ break; number = ip; } @@ -225,7 +225,7 @@ char ** fract; /* the fractionnal part */ for (i=0, fp=fraction; precision > 0 && i < MAX_FRACT ; i++, precision-- ) { fraction_part[i] = (int)((fp + PRECISION)*10. + '0'); - if (! isdigit(fraction_part[i])) /* underflow ? */ + if (! isdigit((unsigned char)fraction_part[i])) /* underflow ? */ break; fp = (fp*10.0) - (double)(long)((fp + PRECISION)*10.); } @@ -474,7 +474,7 @@ struct DATA * p; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': /* gob all the digits */ - for (i = 0; isdigit(*s); i++, s++) + for (i = 0; isdigit((unsigned char)*s); i++, s++) if (i < MAX_FIELD/2 - 1) number[i] = *s; number[i] = '\0'; @@ -621,7 +621,7 @@ va_list args; case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': /* initialize width and precision */ - for (i = 0; isflag(*data.pf); i++, data.pf++) + for (i = 0; isflag((unsigned char)*data.pf); i++, data.pf++) if (i < MAX_FIELD - 1) conv_field[i] = *data.pf; conv_field[i] = '\0'; |