make getaddrinfo return error if both host and service name are null

this case is specified as a mandatory ("shall fail") error.

based on patch by Julien Ramseier.
This commit is contained in:
Rich Felker 2015-09-25 01:01:11 +00:00
parent b4d94ba40d
commit 06bcf9bc94

View File

@ -20,6 +20,8 @@ int getaddrinfo(const char *restrict host, const char *restrict serv, const stru
} sa;
} *out;
if (!host && !serv) return EAI_NONAME;
if (hint) {
family = hint->ai_family;
flags = hint->ai_flags;