From: Guy Harris Date: Tue, 20 Mar 2018 20:01:28 +0000 (-0700) Subject: Squelch warnings. X-Git-Tag: libpcap-1.9-bp~206 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/272b68fec5624355f09206ef5f497c84fe69c265 Squelch warnings. Cast bytes read from getc(), and already known not to be EOF, to u_char before treating them as unsigned 8-bit bytes. --- diff --git a/etherent.c b/etherent.c index 5930eae2..5f499613 100644 --- a/etherent.c +++ b/etherent.c @@ -106,13 +106,13 @@ pcap_next_etherent(FILE *fp) /* must be the start of an address */ for (i = 0; i < 6; i += 1) { - d = xdtoi(c); + d = xdtoi((u_char)c); c = getc(fp); if (c == EOF) return (NULL); if (isxdigit(c)) { d <<= 4; - d |= xdtoi(c); + d |= xdtoi((u_char)c); c = getc(fp); if (c == EOF) return (NULL); @@ -152,7 +152,7 @@ pcap_next_etherent(FILE *fp) /* Use 'namesize' to prevent buffer overflow. */ namesize = sizeof(e.name) - 1; do { - *bp++ = c; + *bp++ = (u_char)c; c = getc(fp); if (c == EOF) return (NULL);