[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.
This commit is contained in:
Alexey Gorgurov 2019-06-28 23:15:00 +03:00 committed by Hermès Bélusca-Maïto
parent 86d4156c39
commit f6f66fa987
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0

View file

@ -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);