diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-04-14 06:57:45 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-04-14 06:57:45 +0000 |
commit | 8fcc183b874c4a30d9443a0f22d903bb4365b5ac (patch) | |
tree | 4c7ff33f2135e68600087dae2f6da1989666fc71 /lib | |
parent | 0a89a3348beb13c6995772777d62950ab4d17785 (diff) |
with this here commit i label myself not the swiftest
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/net/gethostnamadr.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/libc/net/gethostnamadr.c b/lib/libc/net/gethostnamadr.c index 98652e00668..7ce0f9c3bd4 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.20 1997/04/13 01:50:21 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: gethostnamadr.c,v 1.21 1997/04/14 06:57:44 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -141,15 +141,13 @@ _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 == '.')) + if (strchr("-_/.[]\\", c) || + (c == '.' && p[1] == '.')) return 0; } return 1; |