Skip to content

Commit f5f13b5

Browse files
authored
Merge pull request libgit2#4280 from ids1024/htons
Convert port with htons() in p_getaddrinfo()
2 parents 6b2133b + ef09eae commit f5f13b5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/posix.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ int p_getaddrinfo(
4040
if (ainfo->ai_servent)
4141
ainfo->ai_port = ainfo->ai_servent->s_port;
4242
else
43-
ainfo->ai_port = atol(port);
43+
ainfo->ai_port = htons(atol(port));
4444

4545
memcpy(&ainfo->ai_addr_in.sin_addr,
4646
ainfo->ai_hostent->h_addr_list[0],

0 commit comments

Comments
 (0)