Cast bytes read from getc(), and already known not to be EOF, to u_char
before treating them as unsigned 8-bit bytes.
/* 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);
/* 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);