summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-04-13 01:50:22 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-04-13 01:50:22 +0000
commita3941c2939c386106a80fcf5b59c9ab4bf79ec49 (patch)
treeee693dd265b4e52a37913752f041593d6f19fa92 /lib
parent39f10204e46d09965bee8d7c40bc0e8e2ce77f9f (diff)
repair _hokchar
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/net/gethostnamadr.c14
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;