From: eric Date: Thu, 8 Oct 2015 14:08:44 +0000 (+0000) Subject: fix conditionals X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=9936a0e983044822375a0d5cdebec20c3623866c;p=openbsd fix conditionals ok deraadt@ --- 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 * @@ -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 * @@ -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();