зеркало из https://github.com/github/putty.git
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.
This commit is contained in:
Родитель
98528db25a
Коммит
daa086fe73
|
@ -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);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче