1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-25 09:12:24 +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

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