Commit 13eef3d6 authored by Mike Kaplinskiy's avatar Mike Kaplinskiy Committed by Alexandre Julliard

ws2_32: Remember to convert ports to network byte order.

parent afd33d61
......@@ -4959,7 +4959,7 @@ INT WINAPI WSAStringToAddressA(LPSTR AddressString,
ptrPort = strchr(workBuffer, ':');
if(ptrPort)
{
((LPSOCKADDR_IN)lpAddress)->sin_port = (WS_u_short)atoi(ptrPort+1);
((LPSOCKADDR_IN)lpAddress)->sin_port = htons(atoi(ptrPort+1));
*ptrPort = '\0';
}
else
......@@ -5002,7 +5002,7 @@ INT WINAPI WSAStringToAddressA(LPSTR AddressString,
ptrPort = strchr(workBuffer, ']');
if(ptrPort && *(++ptrPort) == ':')
{
((LPSOCKADDR_IN6)lpAddress)->sin6_port = (WS_u_short)atoi(ptrPort+1);
((LPSOCKADDR_IN6)lpAddress)->sin6_port = htons(atoi(ptrPort+1));
*ptrPort = '\0';
}
else
......
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