ws2_32: Remember to convert ports to network byte order.

This commit is contained in:
Mike Kaplinskiy 2009-09-13 17:54:54 -04:00 committed by Alexandre Julliard
parent afd33d618f
commit 13eef3d691
1 changed files with 2 additions and 2 deletions

View File

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