X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/688861a828dce616dbc0b67397558b2ecaaa8a75..a749079eca39b446ab008a25492fc1520d98b840:/windows/winmisc.c diff --git a/windows/winmisc.c b/windows/winmisc.c index 525d52c5..c719c726 100644 --- a/windows/winmisc.c +++ b/windows/winmisc.c @@ -210,7 +210,7 @@ const char *win_strerror(int error) es = find234(errstrings, &error, errstring_find); if (!es) { - int bufsize, bufused; + int bufsize; es = snew(struct errstring); es->error = error; @@ -220,7 +220,7 @@ const char *win_strerror(int error) if (!FormatMessage((FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS), NULL, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - es->text + bufused, bufsize - bufused, NULL)) { + es->text, bufsize, NULL)) { sprintf(es->text, "Windows error code %d (and FormatMessage returned %d)", error, GetLastError());