mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-26 09:42:25 +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
@ -221,7 +221,7 @@ const char *win_strerror(int error)
|
|||||||
msgtext, lenof(msgtext)-1, NULL)) {
|
msgtext, lenof(msgtext)-1, NULL)) {
|
||||||
sprintf(msgtext,
|
sprintf(msgtext,
|
||||||
"(unable to format: FormatMessage returned %d)",
|
"(unable to format: FormatMessage returned %d)",
|
||||||
error, GetLastError());
|
GetLastError());
|
||||||
} else {
|
} else {
|
||||||
int len = strlen(msgtext);
|
int len = strlen(msgtext);
|
||||||
if (len > 0 && msgtext[len-1] == '\n')
|
if (len > 0 && msgtext[len-1] == '\n')
|
||||||
|
Loading…
Reference in New Issue
Block a user