Fix bug recently introduced to fatalerror().

This commit is contained in:
Anthony J. Bentley
2013-05-28 02:22:49 -06:00
parent 35448887af
commit 23b29a9ae1

View File

@@ -206,26 +206,32 @@ opt_Pop(void)
*
*/
void
yyerror(const char *fmt, ...)
void
verror(const char *fmt, va_list args)
{
fprintf(stderr, "ERROR:\t");
fstk_Dump();
fprintf(stderr, " :\n\t");
va_list args;
va_start(args, fmt);
vfprintf(stderr, fmt, args);
va_end(args);
fprintf(stderr, "\n");
nErrors += 1;
}
void
yyerror(const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
verror(fmt, args);
va_end(args);
}
void
fatalerror(const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
yyerror(fmt, args);
verror(fmt, args);
va_end(args);
exit(5);
}