ref: cf7e9ca4944f5a8433c851a01b2539be1dcfd4a5
parent: 378bae2d4f790c8ed89e3c0f502be7d728791bec
author: Quentin Rameau <[email protected]>
date: Sat Jun 4 08:59:31 EDT 2016
[driver] modify argument number check in addarg() We only need to reserve args[0]: argv0 and args[NARGS - 1]: NULL
--- a/driver/posix/scc.c
+++ b/driver/posix/scc.c
@@ -140,7 +140,7 @@
addarg(int tool, char *arg) {
struct tool *t = &tools[tool];
- if (t->nargs >= NARGS - 3) /* 3: argv0, filename, NULL terminator */
+ if (!(t->nargs < NARGS - 2)) /* 2: argv0, NULL terminator */
die("scc: too many parameters given");
t->args[++t->nargs] = arg;