diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-10-17 16:10:53 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-10-17 23:11:18 +0000 |
commit | 033f096ee909b63c0692b80416797f743940d054 (patch) | |
tree | 0ec827ec1bfa5a7893c19e81f27d782797a66644 /epan/addr_resolv.c | |
parent | 344c2bbb5e2a23764fe21adeaf2439d267960a96 (diff) |
Don't use ctype.h routines.
That avoids locale dependency and handles possibly-signed chars (which
we weren't always doing before).
Change-Id: Ieceb93029252f646397b6488f2df8a57c6d2a23d
Reviewed-on: https://code.wireshark.org/review/4794
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/addr_resolv.c')
-rw-r--r-- | epan/addr_resolv.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/epan/addr_resolv.c b/epan/addr_resolv.c index 626f29c1ab..8001812a41 100644 --- a/epan/addr_resolv.c +++ b/epan/addr_resolv.c @@ -24,7 +24,6 @@ #include "config.h" -#include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -1047,7 +1046,7 @@ parse_ether_address(const char *cp, ether_t *eth, unsigned int *mask, for (i = 0; i < 6; i++) { /* Get a hex number, 1 or 2 digits, no sign characters allowed. */ - if (!isxdigit((unsigned char)*cp)) + if (!g_ascii_isxdigit(*cp)) return FALSE; num = strtoul(cp, &p, 16); if (p == cp) @@ -1065,13 +1064,13 @@ parse_ether_address(const char *cp, ether_t *eth, unsigned int *mask, return FALSE; } cp++; /* skip past the '/' to get to the mask */ - if (!isdigit((unsigned char)*cp)) + if (!g_ascii_isdigit(*cp)) return FALSE; /* no sign allowed */ num = strtoul(cp, &p, 10); if (p == cp) return FALSE; /* failed */ cp = p; /* skip past the number */ - if (*cp != '\0' && !isspace((unsigned char)*cp)) + if (*cp != '\0' && !g_ascii_isspace(*cp)) return FALSE; /* bogus terminator */ if (num == 0 || num >= 48) return FALSE; /* bogus mask */ |