From: Jeff King Date: Mon, 14 Dec 2015 20:52:41 +0000 (-0500) Subject: ident: fix undefined variable when NO_IPV6 is set X-Git-Tag: v2.7.0-rc1~3^2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/58d29ececf8fc287d9b244c617edd174ded66b01 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 Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- diff --git a/ident.c b/ident.c index 4e7f99d5dd..00a62e0c42 100644 --- a/ident.c +++ b/ident.c @@ -86,7 +86,7 @@ static int canonical_name(const char *host, struct strbuf *out) freeaddrinfo(ai); } #else - struct hostent *he = gethostbyname(buf); + struct hostent *he = gethostbyname(host); if (he && strchr(he->h_name, '.')) { strbuf_addstr(out, he->h_name); status = 0;