summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEric Faurot <eric@cvs.openbsd.org>2015-10-08 14:08:45 +0000
committerEric Faurot <eric@cvs.openbsd.org>2015-10-08 14:08:45 +0000
commite32164d8b4dd7df66da86e8d8e52154826225677 (patch)
treec29a0f5532640a3a6527850362bf8a83c3396e71 /lib
parent8a9d6d97d63cb1bb4d85c18f96778de4c4cebe2b (diff)
fix conditionals
ok deraadt@
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/asr/getaddrinfo.c4
-rw-r--r--lib/libc/asr/getaddrinfo_async.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/libc/asr/getaddrinfo.c b/lib/libc/asr/getaddrinfo.c
index b6ce8a9d64d..37fe2d4d449 100644
--- a/lib/libc/asr/getaddrinfo.c
+++ b/lib/libc/asr/getaddrinfo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getaddrinfo.c,v 1.8 2015/10/08 13:55:56 deraadt Exp $ */
+/* $OpenBSD: getaddrinfo.c,v 1.9 2015/10/08 14:08:44 eric Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -32,7 +32,7 @@ getaddrinfo(const char *hostname, const char *servname,
struct asr_result ar;
int saved_errno = errno;
- if (hints && (hints->ai_flags & AI_NUMERICHOST) == 0)
+ if (hints == NULL || (hints->ai_flags & AI_NUMERICHOST) == 0)
res_init();
as = getaddrinfo_async(hostname, servname, hints, NULL);
diff --git a/lib/libc/asr/getaddrinfo_async.c b/lib/libc/asr/getaddrinfo_async.c
index 0a411adac63..11e180bfb01 100644
--- a/lib/libc/asr/getaddrinfo_async.c
+++ b/lib/libc/asr/getaddrinfo_async.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getaddrinfo_async.c,v 1.47 2015/10/08 13:55:56 deraadt Exp $ */
+/* $OpenBSD: getaddrinfo_async.c,v 1.48 2015/10/08 14:08:44 eric Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -88,7 +88,7 @@ getaddrinfo_async(const char *hostname, const char *servname,
struct asr_query *as;
char alias[MAXDNAME];
- if (hints && (hints->ai_flags & AI_NUMERICHOST) == 0)
+ if (hints == NULL || (hints->ai_flags & AI_NUMERICHOST) == 0)
ac = _asr_use_resolver(asr);
else
ac = _asr_no_resolver();