Commit 35555862 authored by Andrew Talbot's avatar Andrew Talbot Committed by Alexandre Julliard

ws2_32: Replace switch statement with more suitable if statement.

parent 4bebe628
...@@ -5356,14 +5356,18 @@ SOCKET WINAPI WSASocketW(int af, int type, int protocol, ...@@ -5356,14 +5356,18 @@ SOCKET WINAPI WSASocketW(int af, int type, int protocol,
} }
if ( af == AF_UNSPEC) /* did they not specify the address family? */ if ( af == AF_UNSPEC) /* did they not specify the address family? */
switch(protocol) {
{ if ((protocol == IPPROTO_TCP && type == SOCK_STREAM) ||
case IPPROTO_TCP: (protocol == IPPROTO_UDP && type == SOCK_DGRAM))
if (type == SOCK_STREAM) { af = AF_INET; break; } {
case IPPROTO_UDP: af = AF_INET;
if (type == SOCK_DGRAM) { af = AF_INET; break; }
default: SetLastError(WSAEPROTOTYPE); return INVALID_SOCKET;
} }
else
{
SetLastError(WSAEPROTOTYPE);
return INVALID_SOCKET;
}
}
SERVER_START_REQ( create_socket ) SERVER_START_REQ( create_socket )
{ {
......
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