dect
/
libpcap
Archived
13
0
Fork 0

Cast the argument to <ctype.h> macros to "unsigned char", to eliminate

GCC warnings and to keep the macros from referring outside an array when
handed bytes with the 8th bit set.
This commit is contained in:
guy 2001-07-28 22:56:34 +00:00
parent 7fd1de18e7
commit b92ebafe8e
2 changed files with 6 additions and 5 deletions

7
inet.c
View File

@ -33,7 +33,7 @@
#ifndef lint
static const char rcsid[] =
"@(#) $Header: /tcpdump/master/libpcap/inet.c,v 1.37 2001-06-18 23:43:16 itojun Exp $ (LBL)";
"@(#) $Header: /tcpdump/master/libpcap/inet.c,v 1.38 2001-07-28 22:56:34 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@ -235,10 +235,11 @@ pcap_lookupdev(errbuf)
continue;
endcp = ifrp->ifr_name + strlen(ifrp->ifr_name);
for (cp = ifrp->ifr_name; cp < endcp && !isdigit(*cp); ++cp)
for (cp = ifrp->ifr_name;
cp < endcp && !isdigit((unsigned char)*cp); ++cp)
continue;
if (isdigit (*cp)) {
if (isdigit ((unsigned char)*cp)) {
n = atoi(cp);
} else {
n = 0;

View File

@ -24,7 +24,7 @@
#ifndef lint
static const char rcsid[] =
"@(#) $Header: /tcpdump/master/libpcap/nametoaddr.c,v 1.59 2001-06-27 05:11:48 guy Exp $ (LBL)";
"@(#) $Header: /tcpdump/master/libpcap/nametoaddr.c,v 1.60 2001-07-28 22:56:35 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@ -313,7 +313,7 @@ pcap_ether_aton(const char *s)
if (*s == ':')
s += 1;
d = xdtoi(*s++);
if (isxdigit(*s)) {
if (isxdigit((unsigned char)*s)) {
d <<= 4;
d |= xdtoi(*s++);
}