diff options
| author | deraadt <> | 1997-04-13 01:50:21 +0000 |
|---|---|---|
| committer | deraadt <> | 1997-04-13 01:50:21 +0000 |
| commit | b539a2623fae607f3bf71b2c332462ab4335dd42 (patch) | |
| tree | 8d34669a125a9989e1cf66b7aac42323c422d269 /src | |
| parent | 4e76ec3d9609041673c88a6227b76069612bbc08 (diff) | |
| download | openbsd-b539a2623fae607f3bf71b2c332462ab4335dd42.tar.gz openbsd-b539a2623fae607f3bf71b2c332462ab4335dd42.tar.bz2 openbsd-b539a2623fae607f3bf71b2c332462ab4335dd42.zip | |
repair _hokchar
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libc/net/gethostnamadr.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/lib/libc/net/gethostnamadr.c b/src/lib/libc/net/gethostnamadr.c index 91a0213403..98652e0066 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) |
| 55 | static char rcsid[] = "$OpenBSD: gethostnamadr.c,v 1.19 1997/04/03 08:33:03 downsj Exp $"; | 55 | static char rcsid[] = "$OpenBSD: gethostnamadr.c,v 1.20 1997/04/13 01:50:21 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,13 +141,15 @@ _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; | ||
| 144 | while ((c = *p++)) { | 146 | while ((c = *p++)) { |
| 145 | if (('a' >= c && c <= 'z') || | 147 | if (('a' <= c && c >= 'z') || |
| 146 | ('A' >= c && c <= 'Z') || | 148 | ('A' <= c && c >= 'Z') || |
| 147 | ('0' >= c && c <= '9')) | 149 | ('0' <= c && c >= '9')) |
| 148 | continue; | 150 | continue; |
| 149 | if (strchr("-_/.[]\\", c) || | 151 | if (strchr("-_/[]\\", c) || |
| 150 | (c == '.' && p[1] == '.')) | 152 | (c == '.' && *p == '.')) |
| 151 | return 0; | 153 | return 0; |
| 152 | } | 154 | } |
| 153 | return 1; | 155 | return 1; |
