mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-17 01:11:45 +00:00
Ensure Sys_Error can not form an infinite loop.
I don't remember what propted this change, but it seems like a good idea anyway, so get it into the repository and clean out my stash :)
This commit is contained in:
parent
f7b52e0e15
commit
cf2845a387
1 changed files with 8 additions and 0 deletions
|
@ -430,6 +430,14 @@ Sys_Error (const char *error, ...)
|
|||
#ifdef VA_LIST_IS_ARRAY
|
||||
va_list tmp_args;
|
||||
#endif
|
||||
static int in_sys_error = 0;
|
||||
|
||||
if (in_sys_error) {
|
||||
const char *msg = "\nSys_Error: recursive error condition\n";
|
||||
write (2, msg, strlen (msg));
|
||||
abort ();
|
||||
}
|
||||
in_sys_error = 1;
|
||||
|
||||
va_start (args, error);
|
||||
#ifdef VA_LIST_IS_ARRAY
|
||||
|
|
Loading…
Reference in a new issue