shithub: rgbds

Download patch

ref: 23b29a9ae1a4f0f6be1ef7a2db4f59f4aace17c5
parent: 35448887afcd54313435ad7e4dd3b9ef0950e7f7
author: Anthony J. Bentley <[email protected]>
date: Mon May 27 22:22:49 EDT 2013

Fix bug recently introduced to fatalerror().

--- a/src/asm/main.c
+++ b/src/asm/main.c
@@ -206,26 +206,32 @@
  *
  */
 
-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);
 }