]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
q_cake: remove useless check on argv
authorAndrea Claudi <aclaudi@redhat.com>
Tue, 13 Apr 2021 22:50:20 +0000 (00:50 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Wed, 14 Apr 2021 02:16:55 +0000 (19:16 -0700)
In cake_parse_opt(), *argv is checked not to be null when parsing for
overhead and mpu parameters. However this is useless, since *argv
matches right before for "overhead" or "mpu".

Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
tc/q_cake.c

index 4ff6056a1ab0ea28a9106b9a2f8077bef31dc085..4cfc1c00264a8fce81579d580dd02d5c16156eaa 100644 (file)
@@ -299,8 +299,7 @@ static int cake_parse_opt(struct qdisc_util *qu, int argc, char **argv,
 
                        NEXT_ARG();
                        overhead = strtol(*argv, &p, 10);
-                       if (!p || *p || !*argv ||
-                           overhead < -64 || overhead > 256) {
+                       if (!p || *p || overhead < -64 || overhead > 256) {
                                fprintf(stderr,
                                        "Illegal \"overhead\", valid range is -64 to 256\\n");
                                return -1;
@@ -312,7 +311,7 @@ static int cake_parse_opt(struct qdisc_util *qu, int argc, char **argv,
 
                        NEXT_ARG();
                        mpu = strtol(*argv, &p, 10);
-                       if (!p || *p || !*argv || mpu < 0 || mpu > 256) {
+                       if (!p || *p || mpu < 0 || mpu > 256) {
                                fprintf(stderr,
                                        "Illegal \"mpu\", valid range is 0 to 256\\n");
                                return -1;