[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Patch] Replace deprecated WSAStringToAddressA
[Thread Prev] | [Thread Next]
- Subject: [Patch] Replace deprecated WSAStringToAddressA
- From: Chris Ruehl <chris.ruehl@xxxxxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Wed, 7 Jun 2017 13:40:50 +0800
- To: libssh@xxxxxxxxxx
Replace deprecated WSAStringToAddressA with WSAStringToAddressW This patch solve the deprecated warning and use the recommended function WSAStringToAddressW. diff --git a/src/misc.c b/src/misc.c index ef9b6ff8..80e66acb 100644 --- a/src/misc.c +++ b/src/misc.c @@ -167,8 +167,7 @@ int ssh_is_ipaddr_v4(const char *str) { if (strlen(str) < 7) { return 0; } - - rc = WSAStringToAddressA((LPSTR) str, + rc = WSAStringToAddressW((LPWSTR) str, AF_INET, NULL, (struct sockaddr*)&ss, @@ -188,7 +187,7 @@ int ssh_is_ipaddr(const char *str) { int sslen = sizeof(ss); /* TODO link-local (IP:v6:addr%ifname). */ - rc = WSAStringToAddressA((LPSTR) str, + rc = WSAStringToAddressW((LPWSTR) str, AF_INET6, NULL, (struct sockaddr*)&ss,
Re: [Patch] Replace deprecated WSAStringToAddressA | Aris Adamantiadis <aris@xxxxxxxxxxxx> |