Commit f5f13b50 by Patrick Steinhardt Committed by GitHub

Merge pull request #4280 from ids1024/htons

Convert port with htons() in p_getaddrinfo()
parents 6b2133b4 ef09eae1
...@@ -40,7 +40,7 @@ int p_getaddrinfo( ...@@ -40,7 +40,7 @@ int p_getaddrinfo(
if (ainfo->ai_servent) if (ainfo->ai_servent)
ainfo->ai_port = ainfo->ai_servent->s_port; ainfo->ai_port = ainfo->ai_servent->s_port;
else else
ainfo->ai_port = atol(port); ainfo->ai_port = htons(atol(port));
memcpy(&ainfo->ai_addr_in.sin_addr, memcpy(&ainfo->ai_addr_in.sin_addr,
ainfo->ai_hostent->h_addr_list[0], ainfo->ai_hostent->h_addr_list[0],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment