diff options
| author | niklas <> | 1999-05-30 14:06:08 +0000 |
|---|---|---|
| committer | niklas <> | 1999-05-30 14:06:08 +0000 |
| commit | 6563b2b973d8d8a94e467636dc0c78305c3c8272 (patch) | |
| tree | e3477b7df7dd0cd5aa9b8dfa92fb586943ab3d1f /src/lib/libc/net/gethostnamadr.c | |
| parent | 924515169e7f60cd3b28d5b0e8dcd078838a2cc4 (diff) | |
| download | openbsd-6563b2b973d8d8a94e467636dc0c78305c3c8272.tar.gz openbsd-6563b2b973d8d8a94e467636dc0c78305c3c8272.tar.bz2 openbsd-6563b2b973d8d8a94e467636dc0c78305c3c8272.zip | |
Some extra error checking, documentation and style wrt connections
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libc/net/gethostnamadr.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/libc/net/gethostnamadr.c b/src/lib/libc/net/gethostnamadr.c index 7c4c74a5e9..efd1ddece7 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.32 1999/04/28 19:13:35 niklas Exp $"; | 55 | static char rcsid[] = "$OpenBSD: gethostnamadr.c,v 1.33 1999/05/30 14:06:07 niklas 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> |
| @@ -282,7 +282,11 @@ getanswer(answer, anslen, qname, qtype) | |||
| 282 | } | 282 | } |
| 283 | if (qtype == T_PTR && type == T_CNAME) { | 283 | if (qtype == T_PTR && type == T_CNAME) { |
| 284 | n = dn_expand(answer->buf, eom, cp, tbuf, sizeof tbuf); | 284 | n = dn_expand(answer->buf, eom, cp, tbuf, sizeof tbuf); |
| 285 | #ifdef USE_RESOLV_NAME_OK | ||
| 285 | if ((n < 0) || !res_hnok(tbuf)) { | 286 | if ((n < 0) || !res_hnok(tbuf)) { |
| 287 | #else | ||
| 288 | if ((n < 0) || !_hokchar(tbuf)) { | ||
| 289 | #endif | ||
| 286 | had_error++; | 290 | had_error++; |
| 287 | continue; | 291 | continue; |
| 288 | } | 292 | } |
| @@ -316,7 +320,11 @@ getanswer(answer, anslen, qname, qtype) | |||
| 316 | continue; /* XXX - had_error++ ? */ | 320 | continue; /* XXX - had_error++ ? */ |
| 317 | } | 321 | } |
| 318 | n = dn_expand(answer->buf, eom, cp, bp, buflen); | 322 | n = dn_expand(answer->buf, eom, cp, bp, buflen); |
| 323 | #ifdef USE_RESOLV_NAME_OK | ||
| 319 | if ((n < 0) || !res_hnok(bp)) { | 324 | if ((n < 0) || !res_hnok(bp)) { |
| 325 | #else | ||
| 326 | if ((n < 0) || !_hokchar(bp)) { | ||
| 327 | #endif | ||
| 320 | had_error++; | 328 | had_error++; |
| 321 | break; | 329 | break; |
| 322 | } | 330 | } |
