https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f6f66fa987a9d80e2aaa20e6c10901525db7031b

commit f6f66fa987a9d80e2aaa20e6c10901525db7031b
Author:     Alexey Gorgurov <[email protected]>
AuthorDate: Fri Jun 28 23:15:00 2019 +0300
Commit:     Hermès Bélusca-Maïto <[email protected]>
CommitDate: Sat Jun 29 16:58:47 2019 +0200

    [NETSTAT] Fix TCP/UDP output. (#1696)
    CORE-16151
    
    The underlying StringCchPrintfW() function must use %S for CHAR strings
    and %s for wide chars.
    See
    
https://docs.microsoft.com/en-us/cpp/c-runtime-library/format-specification-syntax-printf-and-wprintf-functions?view=vs-2019
    for details.
---
 base/applications/network/netstat/netstat.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/base/applications/network/netstat/netstat.c 
b/base/applications/network/netstat/netstat.c
index 0e8146f81b..9dab17daf6 100644
--- a/base/applications/network/netstat/netstat.c
+++ b/base/applications/network/netstat/netstat.c
@@ -482,7 +482,7 @@ VOID ShowTcpTable(VOID)
                 PID[0] = 0;
             }
 
-            ConPrintf(StdOut, L"  %-6s %-22s %-22s %-11s %s\n", L"TCP",
+            ConPrintf(StdOut, L"  %-6s %-22S %-22S %-11s %S\n", L"TCP",
                       Host, Remote, TcpState[tcpTable->table[i].dwState], PID);
         }
     }
@@ -536,7 +536,7 @@ VOID ShowUdpTable(VOID)
             PID[0] = 0;
         }
 
-        ConPrintf(StdOut, L"  %-6s %-22s %-34s %s\n", L"UDP", Host, L"*:*", 
PID);
+        ConPrintf(StdOut, L"  %-6s %-22S %-34s %S\n", L"UDP", Host, L"*:*", 
PID);
     }
 
     HeapFree(GetProcessHeap(), 0, udpTable);

Reply via email to