diff options
Diffstat (limited to 'src/lib/libc/net/ethers.c')
| -rw-r--r-- | src/lib/libc/net/ethers.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/libc/net/ethers.c b/src/lib/libc/net/ethers.c index d4243ff1da..af31bb8e60 100644 --- a/src/lib/libc/net/ethers.c +++ b/src/lib/libc/net/ethers.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ethers.c,v 1.20 2005/08/06 20:30:03 espie Exp $ */ | 1 | /* $OpenBSD: ethers.c,v 1.21 2013/11/24 23:51:28 deraadt Exp $ */ |
| 2 | 2 | ||
| 3 | /* | 3 | /* |
| 4 | * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> | 4 | * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> |
| @@ -64,7 +64,7 @@ _ether_aton(const char *s, struct ether_addr *e) | |||
| 64 | long l; | 64 | long l; |
| 65 | char *pp; | 65 | char *pp; |
| 66 | 66 | ||
| 67 | while (isspace(*s)) | 67 | while (isspace((unsigned char)*s)) |
| 68 | s++; | 68 | s++; |
| 69 | 69 | ||
| 70 | /* expect 6 hex octets separated by ':' or space/NUL if last octet */ | 70 | /* expect 6 hex octets separated by ':' or space/NUL if last octet */ |
| @@ -72,7 +72,9 @@ _ether_aton(const char *s, struct ether_addr *e) | |||
| 72 | l = strtol(s, &pp, 16); | 72 | l = strtol(s, &pp, 16); |
| 73 | if (pp == s || l > 0xFF || l < 0) | 73 | if (pp == s || l > 0xFF || l < 0) |
| 74 | return (NULL); | 74 | return (NULL); |
| 75 | if (!(*pp == ':' || (i == 5 && (isspace(*pp) || *pp == '\0')))) | 75 | if (!(*pp == ':' || |
| 76 | (i == 5 && (isspace((unsigned char)*pp) || | ||
| 77 | *pp == '\0')))) | ||
| 76 | return (NULL); | 78 | return (NULL); |
| 77 | e->ether_addr_octet[i] = (u_char)l; | 79 | e->ether_addr_octet[i] = (u_char)l; |
| 78 | s = pp + 1; | 80 | s = pp + 1; |
| @@ -216,7 +218,7 @@ ether_line(const char *line, struct ether_addr *e, char *hostname) | |||
| 216 | goto bad; | 218 | goto bad; |
| 217 | 219 | ||
| 218 | /* Now get the hostname */ | 220 | /* Now get the hostname */ |
| 219 | while (isspace(*p)) | 221 | while (isspace((unsigned char)*p)) |
| 220 | p++; | 222 | p++; |
| 221 | if (*p == '\0') | 223 | if (*p == '\0') |
| 222 | goto bad; | 224 | goto bad; |
