]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
tc_util: Drop needless pointer check
authorPhil Sutter <phil@nwl.cc>
Wed, 15 Nov 2017 14:01:30 +0000 (15:01 +0100)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 17 Nov 2017 00:01:48 +0000 (16:01 -0800)
The function parse_action_control_slash() returns early if 'p' is NULL,
so after the first call to action_a2n(), 'p' is guaranteed not to be
NULL. Otherwise, the assignment '*p = 0' above would dereference the
NULL pointer already anyway, so just drop this check here.

Signed-off-by: Phil Sutter <phil@nwl.cc>
tc/tc_util.c

index 472fc5db71e32d0abb6023d6c9965616883bcc89..9df74da3bfab066a36f19b2ecd46f8ca51253d58 100644 (file)
@@ -630,8 +630,7 @@ int parse_action_control_slash(int *argc_p, char ***argv_p,
                                                         allow_num);
        *p = 0;
        if (action_a2n(*argv, &result1, allow_num)) {
-               if (p)
-                       *p = '/';
+               *p = '/';
                return -1;
        }