]> git.saurik.com Git - redis.git/commitdiff
redis-cli now checks the arity of vararg commnads
authorantirez <antirez@gmail.com>
Sun, 22 Mar 2009 13:59:05 +0000 (14:59 +0100)
committerantirez <antirez@gmail.com>
Sun, 22 Mar 2009 13:59:05 +0000 (14:59 +0100)
redis-cli.c

index f6bf739b3696e6f1caa02b03074321c740e0bf68..38c986b34b81e32a757140ef395af698bd7b1c7e 100644 (file)
@@ -224,7 +224,7 @@ static int cliSendCommand(int argc, char **argv) {
     }
 
     if ((rc->arity > 0 && argc != rc->arity) ||
     }
 
     if ((rc->arity > 0 && argc != rc->arity) ||
-        (rc->arity < 0 && argc < rc->arity)) {
+        (rc->arity < 0 && argc < -rc->arity)) {
             fprintf(stderr,"Wrong number of arguments for '%s'\n",rc->name);
             return 1;
     }
             fprintf(stderr,"Wrong number of arguments for '%s'\n",rc->name);
             return 1;
     }