diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1999-05-30 14:06:09 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1999-05-30 14:06:09 +0000 |
commit | 7a68cef46506bade41798091205ab800203ec194 (patch) | |
tree | d35a7a2cdde3abb83e90a8e23cf673b73fe1780f /lib/libc/net/gethostnamadr.c | |
parent | 8623650b3bbeef30f7af594d65c04bd3035fc023 (diff) |
Some extra error checking, documentation and style wrt connections
Diffstat (limited to 'lib/libc/net/gethostnamadr.c')
-rw-r--r-- | lib/libc/net/gethostnamadr.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/libc/net/gethostnamadr.c b/lib/libc/net/gethostnamadr.c index 7c4c74a5e98..efd1ddece7c 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.32 1999/04/28 19:13:35 niklas Exp $"; +static char rcsid[] = "$OpenBSD: gethostnamadr.c,v 1.33 1999/05/30 14:06:07 niklas Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -282,7 +282,11 @@ getanswer(answer, anslen, qname, qtype) } if (qtype == T_PTR && type == T_CNAME) { n = dn_expand(answer->buf, eom, cp, tbuf, sizeof tbuf); +#ifdef USE_RESOLV_NAME_OK if ((n < 0) || !res_hnok(tbuf)) { +#else + if ((n < 0) || !_hokchar(tbuf)) { +#endif had_error++; continue; } @@ -316,7 +320,11 @@ getanswer(answer, anslen, qname, qtype) continue; /* XXX - had_error++ ? */ } n = dn_expand(answer->buf, eom, cp, bp, buflen); +#ifdef USE_RESOLV_NAME_OK if ((n < 0) || !res_hnok(bp)) { +#else + if ((n < 0) || !_hokchar(bp)) { +#endif had_error++; break; } |