X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/6de8ca59ff2205da724e7172e852bc077c2e5034..d6430b975d14ddbd53c40126fa9d00bea3c2d08b:/pageant.c diff --git a/pageant.c b/pageant.c index 757091ac..0ffb24c2 100644 --- a/pageant.c +++ b/pageant.c @@ -59,6 +59,23 @@ static char *putty_path; #define PUTTY_DEFAULT "Default%20Settings" static int initial_menuitems_count; +/* + * Print a modal (Really Bad) message box and perform a fatal exit. + */ +void modalfatalbox(char *fmt, ...) +{ + va_list ap; + char *buf; + + va_start(ap, fmt); + buf = dupvprintf(fmt, ap); + va_end(ap); + MessageBox(main_hwnd, buf, "Pageant Fatal Error", + MB_SYSTEMMODAL | MB_ICONERROR | MB_OK); + sfree(buf); + exit(1); +} + /* Un-munge session names out of the registry. */ static void unmungestr(char *in, char *out, int outlen) { @@ -137,14 +154,6 @@ struct blob { }; static int cmpkeys_ssh2_asymm(void *av, void *bv); -/* - * This function is needed to link with the DES code. We need not - * have it do anything at all. - */ -void logevent(char *msg) -{ -} - #define GET_32BIT(cp) \ (((unsigned long)(unsigned char)(cp)[0] << 24) | \ ((unsigned long)(unsigned char)(cp)[1] << 16) | \ @@ -1773,10 +1782,11 @@ void spawn_cmd(char *cmdline, char * args, int show) { if (ShellExecute(NULL, _T("open"), cmdline, args, NULL, show) <= (HINSTANCE) 32) { - TCHAR sMsg[140]; - sprintf(sMsg, _T("Failed to run \"%.100s\", Error: %d"), cmdline, - (int)GetLastError()); - MessageBox(NULL, sMsg, APPNAME, MB_OK | MB_ICONEXCLAMATION); + char *msg; + msg = dupprintf("Failed to run \"%.100s\", Error: %d", cmdline, + (int)GetLastError()); + MessageBox(NULL, msg, APPNAME, MB_OK | MB_ICONEXCLAMATION); + sfree(msg); } }