according to the documentation in the man pages, the GNU extension
functions gethostbyaddr_r, gethostbyname_r and gethostbyname2_r are
guaranteed to set the result pointer to NULL in case of error or no
result.
corresponds to commit
fe82bb9b921be34370e6b71a1c6f062c20999ae0 in
master branch.
socklen_t sl = af==AF_INET6 ? sizeof sa.sin6 : sizeof sa.sin;
int i;
+ *res = 0;
+
/* Load address argument into sockaddr structure */
if (af==AF_INET6 && l==16) memcpy(&sa.sin6.sin6_addr, a, 16);
else if (af==AF_INET && l==4) memcpy(&sa.sin.sin_addr, a, 4);
size_t need;
const char *canon;
+ *res = 0;
+
af = hint.ai_family;
/* Align buffer */