void connection_fatal(void *frontend, char *fmt, ...)
{
va_list ap;
- char stuff[200], morestuff[100];
+ char *stuff, morestuff[100];
va_start(ap, fmt);
- vsprintf(stuff, fmt, ap);
+ stuff = dupvprintf(fmt, ap);
va_end(ap);
sprintf(morestuff, "%.70s Fatal Error", appname);
MessageBox(hwnd, stuff, morestuff, MB_ICONERROR | MB_OK);
+ sfree(stuff);
+
if (cfg.close_on_exit == FORCE_ON)
PostQuitMessage(1);
else {
void cmdline_error(char *fmt, ...)
{
va_list ap;
- char stuff[200], morestuff[100];
+ char *stuff, morestuff[100];
va_start(ap, fmt);
- vsprintf(stuff, fmt, ap);
+ stuff = dupvprintf(fmt, ap);
va_end(ap);
sprintf(morestuff, "%.70s Command Line Error", appname);
MessageBox(hwnd, stuff, morestuff, MB_ICONERROR | MB_OK);
+ sfree(stuff);
exit(1);
}
void fatalbox(char *fmt, ...)
{
va_list ap;
- char stuff[200], morestuff[100];
+ char *stuff, morestuff[100];
va_start(ap, fmt);
- vsprintf(stuff, fmt, ap);
+ stuff = dupvprintf(fmt, ap);
va_end(ap);
sprintf(morestuff, "%.70s Fatal Error", appname);
MessageBox(hwnd, stuff, morestuff, MB_ICONERROR | MB_OK);
+ sfree(stuff);
cleanup_exit(1);
}
void modalfatalbox(char *fmt, ...)
{
va_list ap;
- char stuff[200], morestuff[100];
+ char *stuff, morestuff[100];
va_start(ap, fmt);
- vsprintf(stuff, fmt, ap);
+ stuff = dupvprintf(fmt, ap);
va_end(ap);
sprintf(morestuff, "%.70s Fatal Error", appname);
MessageBox(hwnd, stuff, morestuff,
MB_SYSTEMMODAL | MB_ICONERROR | MB_OK);
+ sfree(stuff);
cleanup_exit(1);
}