summaryrefslogtreecommitdiffstats
path: root/lib/libc/net/getaddrinfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/net/getaddrinfo.c')
-rw-r--r--lib/libc/net/getaddrinfo.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/net/getaddrinfo.c b/lib/libc/net/getaddrinfo.c
index 148a95e..aca875f 100644
--- a/lib/libc/net/getaddrinfo.c
+++ b/lib/libc/net/getaddrinfo.c
@@ -2358,9 +2358,9 @@ res_queryN(name, target, res)
}
#endif
- if (n < 0 || n > anslen)
+ if (n > anslen)
hp->rcode = FORMERR; /* XXX not very informative */
- if (hp->rcode != NOERROR || ntohs(hp->ancount) == 0) {
+ if (n < 0 || hp->rcode != NOERROR || ntohs(hp->ancount) == 0) {
rcode = hp->rcode; /* record most recent error */
#ifdef DEBUG
if (res->options & RES_DEBUG)
OpenPOWER on IntegriCloud