diff options
author | 1997-04-13 01:50:21 +0000 | |
---|---|---|
committer | 1997-04-13 01:50:21 +0000 | |
commit | a5c0697b2a9811b22d43e23633da6b6ce854a2e1 (patch) | |
tree | 81961f1fcf715c542f2858f3e9facb2e7384a089 /lib | |
parent | Make MIPS configuration more consistent (diff) | |
download | wireguard-openbsd-a5c0697b2a9811b22d43e23633da6b6ce854a2e1.tar.xz wireguard-openbsd-a5c0697b2a9811b22d43e23633da6b6ce854a2e1.zip |
repair _hokchar
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/net/gethostnamadr.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/libc/net/gethostnamadr.c b/lib/libc/net/gethostnamadr.c index 91a0213403c..98652e00668 100644 --- a/lib/libc/net/gethostnamadr.c +++ b/lib/libc/net/gethostnamadr.c @@ -52,7 +52,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: gethostnamadr.c,v 1.19 1997/04/03 08:33:03 downsj Exp $"; +static char rcsid[] = "$OpenBSD: gethostnamadr.c,v 1.20 1997/04/13 01:50:21 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -141,13 +141,15 @@ _hokchar(p) * tested for below can happen, and we must be more permissive * than the resolver until those idiots clean up their act. */ + if (*p == '.' || *p == '-') + return 0; while ((c = *p++)) { - if (('a' >= c && c <= 'z') || - ('A' >= c && c <= 'Z') || - ('0' >= c && c <= '9')) + if (('a' <= c && c >= 'z') || + ('A' <= c && c >= 'Z') || + ('0' <= c && c >= '9')) continue; - if (strchr("-_/.[]\\", c) || - (c == '.' && p[1] == '.')) + if (strchr("-_/[]\\", c) || + (c == '.' && *p == '.')) return 0; } return 1; |