mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 02:25:40 +00:00
- Remove unreachable code, CID 53
- Simplify parameter checks, fix return value, set last error correctly, fix typo svn path=/trunk/; revision=37940
This commit is contained in:
parent
8019ca7330
commit
866e5d59a0
1 changed files with 32 additions and 36 deletions
|
@ -382,7 +382,7 @@ WSAStringToAddressA(IN LPSTR AddressString,
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @implement
|
* @implemented
|
||||||
*/
|
*/
|
||||||
INT
|
INT
|
||||||
EXPORT
|
EXPORT
|
||||||
|
@ -396,14 +396,15 @@ WSAStringToAddressW(IN LPWSTR AddressString,
|
||||||
int res=0;
|
int res=0;
|
||||||
LONG inetaddr = 0;
|
LONG inetaddr = 0;
|
||||||
LPWSTR *bp=NULL;
|
LPWSTR *bp=NULL;
|
||||||
|
SOCKADDR_IN *sockaddr;
|
||||||
|
|
||||||
SOCKADDR_IN *sockaddr = (SOCKADDR_IN *) lpAddress;
|
if (!lpAddressLength || !lpAddress || !AddressString)
|
||||||
|
{
|
||||||
if (!lpAddressLength || !lpAddress)
|
WSASetLastError(WSAEINVAL);
|
||||||
return SOCKET_ERROR;
|
return SOCKET_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
if (AddressString==NULL)
|
sockaddr = (SOCKADDR_IN *) lpAddress;
|
||||||
return WSAEINVAL;
|
|
||||||
|
|
||||||
/* Set right adress family */
|
/* Set right adress family */
|
||||||
if (lpProtocolInfo!=NULL)
|
if (lpProtocolInfo!=NULL)
|
||||||
|
@ -421,11 +422,7 @@ WSAStringToAddressW(IN LPWSTR AddressString,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!lpAddress)
|
// translate ip string to ip
|
||||||
res = WSAEINVAL;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// translate now ip string to ip
|
|
||||||
|
|
||||||
/* rest sockaddr.sin_addr.s_addr
|
/* rest sockaddr.sin_addr.s_addr
|
||||||
for we need to be sure it is zero when we come to while */
|
for we need to be sure it is zero when we come to while */
|
||||||
|
@ -459,7 +456,6 @@ WSAStringToAddressW(IN LPWSTR AddressString,
|
||||||
|
|
||||||
res = 0;
|
res = 0;
|
||||||
sockaddr->sin_addr.s_addr = inetaddr;
|
sockaddr->sin_addr.s_addr = inetaddr;
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue