[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Patch] Replace deprecated WSAStringToAddressA


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,


Follow-Ups:
Re: [Patch] Replace deprecated WSAStringToAddressAAris Adamantiadis <aris@xxxxxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org