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:
Bill Currie 2011-08-20 13:13:43 +09:00
parent f7b52e0e15
commit cf2845a387

View file

@ -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