From b972b7826531c0800f547de46051a6b90b859822 Mon Sep 17 00:00:00 2001
From: deraadt <>
Date: Mon, 14 Apr 1997 06:57:44 +0000
Subject: with this here commit i label myself not the swiftest

---
 src/lib/libc/net/gethostnamadr.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

(limited to 'src/lib')

diff --git a/src/lib/libc/net/gethostnamadr.c b/src/lib/libc/net/gethostnamadr.c
index 98652e0066..7ce0f9c3bd 100644
--- a/src/lib/libc/net/gethostnamadr.c
+++ b/src/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;
-- 
cgit v1.2.3-55-g6feb