Don't forget to check if max_errors is more than zero
authorRobert Pengelly <robertapengelly@hotmail.com>
Sun, 31 May 2026 11:45:42 +0000 (12:45 +0100)
committerRobert Pengelly <robertapengelly@hotmail.com>
Sun, 31 May 2026 11:45:42 +0000 (12:45 +0100)
report.c

index 2206a2b1ab0d4c777cd20ff4fe470dbb515b86f1..1952abbae3124dbb61f120566146406a9ad1519b 100755 (executable)
--- a/report.c
+++ b/report.c
@@ -158,7 +158,7 @@ void report_at (const char *filename, unsigned long lineno, int type, const char
     output_message (filename, lineno, 0, type, fmt, ap);
     va_end (ap);
     
-    if (errors >= state->max_errors) {
+    if (state->max_errors > 0 && errors >= state->max_errors) {
         exit (EXIT_FAILURE);
     }
 
@@ -256,7 +256,7 @@ void report_line_at (const char *filename, unsigned long lineno, int type, const
     
     }
     
-    if (errors >= state->max_errors) {
+    if (state->max_errors > 0 && errors >= state->max_errors) {
         exit (EXIT_FAILURE);
     }