commit 1cdf7496909e5ec1532ad2fb1903c86f19f57ca6
Author:     Quentin Rameau <[email protected]>
AuthorDate: Sat Jun 4 12:59:31 2016 +0200
Commit:     Quentin Rameau <[email protected]>
CommitDate: Sat Jun 4 12:59:31 2016 +0200

    [driver] modify argument number check in addarg()
    
    We only need to reserve args[0]: argv0 and args[NARGS - 1]: NULL

diff --git a/driver/posix/scc.c b/driver/posix/scc.c
index 526538b..332bd12 100644
--- a/driver/posix/scc.c
+++ b/driver/posix/scc.c
@@ -140,7 +140,7 @@ static void
 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;

Reply via email to