From 89b8e3d6096dc7d6016eb4458bcf4e6bc32951b2 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Sat, 1 Nov 2014 17:43:54 +0000 Subject: [PATCH] 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]. --- windows/winmisc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/windows/winmisc.c b/windows/winmisc.c index 82216587..5bf52141 100644 --- a/windows/winmisc.c +++ b/windows/winmisc.c @@ -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')