]> granicus.if.org Git - strace/commit
pathtrace_select() is never called with NULL, remove dead code
authorDenys Vlasenko <vda.linux@googlemail.com>
Thu, 15 Mar 2012 17:03:56 +0000 (18:03 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Thu, 15 Mar 2012 17:03:56 +0000 (18:03 +0100)
commit29865e77e6eee0c380befd0ce53657b5604975ef
tree966c57874ee67450582ab6f246b04f0b88f33076
parent7c2b1a6dd0788aee1b781a6727f556d8ef381939
pathtrace_select() is never called with NULL, remove dead code

pathtrace_select() is only called for -P FILE options,
and FILE is never a NULL pointer.

   text    data     bss     dec     hex filename
 239453     672   19012  259137   3f441 strace.before
 239329     672   19012  259013   3f3c5 strace

* pathtrace.c (pathtrace_select): Remove "if (path == NULL)...".
(pathtrace_select): Remove code which only executes if path == NULL.
The code was also buggy, it can free non-malloced pointer.
(getfdpath): Simplify snprintf to sprintf.
(pathmatch): Use strcmp() == 0 idiom for string equality test.
(pathtrace_match): Likewise.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
pathtrace.c