1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-02 03:52:49 -05:00

Use correct type to print Windows error codes.

GetLastError returns DWORD. To print it, convert it to unsigned int
and use the %u format specifier.
This commit is contained in:
Tim Kosse
2015-08-11 14:13:20 +02:00
committed by Simon Tatham
parent 1f6504c2de
commit 6539d39755
2 changed files with 4 additions and 4 deletions

View File

@ -222,8 +222,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)",
GetLastError());
"(unable to format: FormatMessage returned %u)",
(unsigned int)GetLastError());
} else {
int len = strlen(msgtext);
if (len > 0 && msgtext[len-1] == '\n')