From b92ebafe8ea74167b21c945bc914440c9416ee67 Mon Sep 17 00:00:00 2001 From: guy Date: Sat, 28 Jul 2001 22:56:34 +0000 Subject: [PATCH] Cast the argument to 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. --- inet.c | 7 ++++--- nametoaddr.c | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/inet.c b/inet.c index b94c8fc..a3375b0 100644 --- a/inet.c +++ b/inet.c @@ -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; diff --git a/nametoaddr.c b/nametoaddr.c index 63e14ac..d9a0389 100644 --- a/nametoaddr.c +++ b/nametoaddr.c @@ -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++); }