Skip to content

Commit 58d29ec

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 00bce77 commit 58d29ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ident.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static int canonical_name(const char *host, struct strbuf *out)
8686
freeaddrinfo(ai);
8787
}
8888
#else
89-
struct hostent *he = gethostbyname(buf);
89+
struct hostent *he = gethostbyname(host);
9090
if (he && strchr(he->h_name, '.')) {
9191
strbuf_addstr(out, he->h_name);
9292
status = 0;

0 commit comments

Comments
 (0)