summaryrefslogtreecommitdiff
path: root/lib/libc/net/gethostbydns.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/net/gethostbydns.c')
-rw-r--r--lib/libc/net/gethostbydns.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/libc/net/gethostbydns.c b/lib/libc/net/gethostbydns.c
index 94e13eb9bb91a..3ee4c6e7c66dc 100644
--- a/lib/libc/net/gethostbydns.c
+++ b/lib/libc/net/gethostbydns.c
@@ -53,7 +53,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93";
-static char rcsid[] = "$Id: gethostbydns.c,v 1.8 1996/01/13 09:03:40 peter Exp $";
+static char rcsid[] = "$Id: gethostbydns.c,v 1.4.4.6 1996/11/22 18:07:52 fenner Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -305,12 +305,11 @@ gethostanswer(answer, anslen, qname, qclass, qtype)
cp += n;
continue; /* XXX - had_error++ ? */
}
- if (haveanswer) {
- if (n != host.h_length) {
- cp += n;
- continue;
- }
- } else {
+ if (n != host.h_length) {
+ cp += n;
+ continue;
+ }
+ if (!haveanswer) {
register int nn;
host.h_length = n;
@@ -393,6 +392,8 @@ _gethostbydnsname(name)
return (NULL);
}
+ host.h_length = INT32SZ;
+
/*
* if there aren't any dots, it could be a user-level alias.
* this is also done in res_query() since we are not the only