diff options
Diffstat (limited to 'strtoaddr.c')
-rw-r--r-- | strtoaddr.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/strtoaddr.c b/strtoaddr.c index e38a9d4e..b3b84972 100644 --- a/strtoaddr.c +++ b/strtoaddr.c @@ -23,6 +23,8 @@ #include <stddef.h> #include <string.h> +#include "netdissect-ctype.h" + #include "strtoaddr.h" #ifndef NS_INADDRSZ @@ -69,18 +71,18 @@ strtoaddr(const char *src, void *dst) * Values are specified as for C: * 0x=hex, 0=octal, isdigit=decimal. */ - if (!isdigit(c)) + if (!ND_ASCII_ISDIGIT(c)) return (0); val = 0; if (c == '0') { c = *++src; if (c == 'x' || c == 'X') return (0); - else if (isdigit(c) && c != '9') + else if (ND_ASCII_ISDIGIT(c) && c != '9') return (0); } for (;;) { - if (isdigit(c)) { + if (ND_ASCII_ISDIGIT(c)) { digit = c - '0'; if (digit >= 10) break; @@ -107,7 +109,7 @@ strtoaddr(const char *src, void *dst) /* * Check for trailing characters. */ - if (c != '\0' && !isspace(c)) + if (c != '\0' && c != ' ' && c != '\t') return (0); /* * Find the number of parts specified. |