208
209
210
211
212
213
214
215
216
217
218
219
220
221
|
}
}
/*
* Print an error message and perform a fatal exit.
*/
void fatalbox(char *fmt, ...)
{
char str[0x100]; /* Make the size big enough */
va_list ap;
va_start(ap, fmt);
strcpy(str, "Fatal: ");
vsprintf(str + strlen(str), fmt, ap);
va_end(ap);
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
|
}
}
/*
* Print an error message and perform a fatal exit.
*/
void fatalbox(char *fmt, ...)
{
char str[0x100]; /* Make the size big enough */
va_list ap;
va_start(ap, fmt);
strcpy(str, "Fatal: ");
vsprintf(str + strlen(str), fmt, ap);
va_end(ap);
strcat(str, "\n");
tell_str(stderr, str);
errs++;
if (gui_mode) {
unsigned int msg_id = WM_RET_ERR_CNT;
if (list)
msg_id = WM_LS_RET_ERR_CNT;
while (!PostMessage
((HWND) atoi(gui_hwnd), msg_id, (WPARAM) errs,
0 /*lParam */ ))SleepEx(1000, TRUE);
}
cleanup_exit(1);
}
void modalfatalbox(char *fmt, ...)
{
char str[0x100]; /* Make the size big enough */
va_list ap;
va_start(ap, fmt);
strcpy(str, "Fatal: ");
vsprintf(str + strlen(str), fmt, ap);
va_end(ap);
|