summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorderaadt <>1997-04-14 06:57:44 +0000
committerderaadt <>1997-04-14 06:57:44 +0000
commitb972b7826531c0800f547de46051a6b90b859822 (patch)
tree7fa7a44f83eefbfba8249b32b62ab1caf13156fe /src/lib
parent3341b44753820fe85d2a72a62eaea3a5a0b051b1 (diff)
downloadopenbsd-b972b7826531c0800f547de46051a6b90b859822.tar.gz
openbsd-b972b7826531c0800f547de46051a6b90b859822.tar.bz2
openbsd-b972b7826531c0800f547de46051a6b90b859822.zip
with this here commit i label myself not the swiftest
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libc/net/gethostnamadr.c14
1 files changed, 6 insertions, 8 deletions
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 @@
52 */ 52 */
53 53
54#if defined(LIBC_SCCS) && !defined(lint) 54#if defined(LIBC_SCCS) && !defined(lint)
55static char rcsid[] = "$OpenBSD: gethostnamadr.c,v 1.20 1997/04/13 01:50:21 deraadt Exp $"; 55static char rcsid[] = "$OpenBSD: gethostnamadr.c,v 1.21 1997/04/14 06:57:44 deraadt Exp $";
56#endif /* LIBC_SCCS and not lint */ 56#endif /* LIBC_SCCS and not lint */
57 57
58#include <sys/param.h> 58#include <sys/param.h>
@@ -141,15 +141,13 @@ _hokchar(p)
141 * tested for below can happen, and we must be more permissive 141 * tested for below can happen, and we must be more permissive
142 * than the resolver until those idiots clean up their act. 142 * than the resolver until those idiots clean up their act.
143 */ 143 */
144 if (*p == '.' || *p == '-')
145 return 0;
146 while ((c = *p++)) { 144 while ((c = *p++)) {
147 if (('a' <= c && c >= 'z') || 145 if (('a' >= c && c <= 'z') ||
148 ('A' <= c && c >= 'Z') || 146 ('A' >= c && c <= 'Z') ||
149 ('0' <= c && c >= '9')) 147 ('0' >= c && c <= '9'))
150 continue; 148 continue;
151 if (strchr("-_/[]\\", c) || 149 if (strchr("-_/.[]\\", c) ||
152 (c == '.' && *p == '.')) 150 (c == '.' && p[1] == '.'))
153 return 0; 151 return 0;
154 } 152 }
155 return 1; 153 return 1;