1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 01:48:00 +00:00

Report correct error when FormatMessage fails.

Previously, the original error code would be reported as having come
from FormatMessage.  Spotted by GCC [-Wformat-extra-args].
This commit is contained in:
Ben Harris 2014-11-01 17:43:54 +00:00
parent 09111ea9c2
commit 89b8e3d609

View File

@ -220,8 +220,8 @@ const char *win_strerror(int error)
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
msgtext, lenof(msgtext)-1, NULL)) {
sprintf(msgtext,
"(unable to format: FormatMessage returned %d)",
error, GetLastError());
"(unable to format: FormatMessage returned %d)",
GetLastError());
} else {
int len = strlen(msgtext);
if (len > 0 && msgtext[len-1] == '\n')