From daa086fe73d667a92de8b380d78302bdad827b85 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Mon, 9 Jul 2018 07:18:08 +0100 Subject: [PATCH] winpgnt.c: fix an outdated error message. I just spotted it while I was looking through this module anyway. It was using %.100s to prevent an sprintf buffer overflow, which hasn't been necessary since I switched everything over to dupprintf, and also it was printing the integer value of GetLastError() without using my convenient translation wrapper win_strerror. --- windows/winpgnt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/windows/winpgnt.c b/windows/winpgnt.c index 2325692c..3734ab17 100644 --- a/windows/winpgnt.c +++ b/windows/winpgnt.c @@ -1136,8 +1136,8 @@ void spawn_cmd(const char *cmdline, const char *args, int show) if (ShellExecute(NULL, _T("open"), cmdline, args, NULL, show) <= (HINSTANCE) 32) { char *msg; - msg = dupprintf("Failed to run \"%.100s\", Error: %d", cmdline, - (int)GetLastError()); + msg = dupprintf("Failed to run \"%s\": %s", cmdline, + win_strerror(GetLastError())); MessageBox(NULL, msg, APPNAME, MB_OK | MB_ICONEXCLAMATION); sfree(msg); }