scc

Simple C99 Compiler
Log | Files | Refs | README | LICENSE

commit 7bb24c18c03aaf5ee073b8bb3bfaa615f4986800
parent 14b14db116c59bfeeed0319493db6ccf3bc33d60
Author: Quentin Rameau <quinq@fifth.space>
Date:   Thu, 26 May 2016 16:56:53 +0200

[cc1] Adjust how errors are counted

Increment the error number before checking it, this way we actually stop
at MAXERRNUM, not MAXERRNUM + 1.

Diffstat:
cc1/error.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cc1/error.c b/cc1/error.c @@ -29,7 +29,7 @@ warn_error(int flag, char *fmt, va_list va) fclose(stdout); } failure = 1; - if (nerrors++ == MAXERRNUM) { + if (++nerrors == MAXERRNUM) { fputs("too many errors\n", stderr); exit(1); }