[hackers] [scc] [driver] modify argument number check in addarg() || Quentin Rameau

From: <git_AT_suckless.org>
Date: Sat, 4 Jun 2016 13:02:20 +0200 (CEST)

commit 1cdf7496909e5ec1532ad2fb1903c86f19f57ca6
Author: Quentin Rameau <quinq_AT_fifth.space>
AuthorDate: Sat Jun 4 12:59:31 2016 +0200
Commit: Quentin Rameau <quinq_AT_fifth.space>
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
_AT_@ -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;
Received on Sat Jun 04 2016 - 13:02:20 CEST

This archive was generated by hypermail 2.3.0 : Sat Jun 04 2016 - 13:12:24 CEST