mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 09:58:01 +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:
parent
09111ea9c2
commit
89b8e3d609
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user