ws2_32: Remember to convert ports to network byte order.
This commit is contained in:
parent
afd33d618f
commit
13eef3d691
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue