iphlpapi: avoid using %n (clang)

Austin English austinenglish at gmail.com
Sun Oct 3 19:31:03 CDT 2010


Clang doesn't like it, and it's a potential security problem.

-- 
-Austin
-------------- next part --------------
diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c
index 081de0e..bdffcf4 100644
--- a/dlls/iphlpapi/iphlpapi_main.c
+++ b/dlls/iphlpapi/iphlpapi_main.c
@@ -657,7 +657,7 @@ static char *debugstr_ipv4(const in_addr_t *in_addr, char *buf)
         {
             int n;
 
-            sprintf(p, "%d.%n", *addrp, &n);
+            n = sprintf(p, "%d.", *addrp);
             p += n;
         }
     }
@@ -687,7 +687,7 @@ static char *debugstr_ipv6(const struct WS_sockaddr_in6 *sin, char *buf)
         {
             int n;
 
-            sprintf(p, "%x:%n", ntohs(addr->u.Word[i]), &n);
+            n = sprintf(p, "%x:", ntohs(addr->u.Word[i]));
             p += n;
             in_zero = FALSE;
         }


More information about the wine-patches mailing list