From f11a3ee4ffc0c81cd1b27af469d8dad6d48fbf49 Mon Sep 17 00:00:00 2001 From: deraadt <> Date: Sun, 24 Nov 2013 23:51:28 +0000 Subject: most obvious unsigned char casts for ctype ok jca krw ingo --- src/lib/libc/net/ethers.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/lib/libc/net/ethers.c') 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 @@ -/* $OpenBSD: ethers.c,v 1.20 2005/08/06 20:30:03 espie Exp $ */ +/* $OpenBSD: ethers.c,v 1.21 2013/11/24 23:51:28 deraadt Exp $ */ /* * Copyright (c) 1998 Todd C. Miller @@ -64,7 +64,7 @@ _ether_aton(const char *s, struct ether_addr *e) long l; char *pp; - while (isspace(*s)) + while (isspace((unsigned char)*s)) s++; /* 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) l = strtol(s, &pp, 16); if (pp == s || l > 0xFF || l < 0) return (NULL); - if (!(*pp == ':' || (i == 5 && (isspace(*pp) || *pp == '\0')))) + if (!(*pp == ':' || + (i == 5 && (isspace((unsigned char)*pp) || + *pp == '\0')))) return (NULL); e->ether_addr_octet[i] = (u_char)l; s = pp + 1; @@ -216,7 +218,7 @@ ether_line(const char *line, struct ether_addr *e, char *hostname) goto bad; /* Now get the hostname */ - while (isspace(*p)) + while (isspace((unsigned char)*p)) p++; if (*p == '\0') goto bad; -- cgit v1.2.3-55-g6feb