ident: fix undefined variable when NO_IPV6 is set
Commit 00bce77 (ident.c: add support for IPv6, 2015-11-27) moved the "gethostbyname" call out of "add_domainname" and into the helper function "canonical_name". But when moving the code, it forgot that the "buf" variable is passed as "host" in the helper. Reported-by: johan defries <johandefries@gmail.com> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
Dec 14, 2015 at 15:52 UTC
58d29ececf8fc287d9b244c617edd174ded66b01
1 file changed
+1
-1
ident.c
+1
-1
@@ -86,7 +86,7 @@ static int canonical_name(const char *host, struct strbuf *out)
86
freeaddrinfo(ai);
87
}
88
#else
89
- struct hostent *he = gethostbyname(buf);
89
+ struct hostent *he = gethostbyname(host);
90
if (he && strchr(he->h_name, '.')) {
91
strbuf_addstr(out, he->h_name);
92
status = 0;