зеркало из https://github.com/github/putty.git
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:
Родитель
1f6504c2de
Коммит
6539d39755
|
@ -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')
|
||||
|
|
|
@ -478,8 +478,8 @@ const char *winsock_error_string(int error)
|
|||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
||||
es->text + bufused, bufsize - bufused, NULL)) {
|
||||
sprintf(es->text + bufused,
|
||||
"Windows error code %d (and FormatMessage returned %d)",
|
||||
error, GetLastError());
|
||||
"Windows error code %d (and FormatMessage returned %u)",
|
||||
error, (unsigned int)GetLastError());
|
||||
} else {
|
||||
int len = strlen(es->text);
|
||||
if (len > 0 && es->text[len-1] == '\n')
|
||||
|
|
Загрузка…
Ссылка в новой задаче