Skip to content

Commit

Permalink
ident: fix undefined variable when NO_IPV6 is set
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jeff King authored and Junio C Hamano committed Dec 14, 2015
1 parent 00bce77 commit 58d29ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ident.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 58d29ec

Please sign in to comment.