diff options
author | Donatas Abraitis <donatas.abraitis@gmail.com> | 2020-07-02 10:39:29 +0200 |
---|---|---|
committer | Donatas Abraitis <donatas.abraitis@gmail.com> | 2020-07-02 10:39:29 +0200 |
commit | c54142bb84e86e563c228a0f82f1d5f6989dd952 (patch) | |
tree | a0faf1e8ee5a2ba0614764894cdf58b9f00dcec8 /tools | |
parent | Merge pull request #6661 from donaldsharp/flag_is_singular (diff) | |
download | frr-c54142bb84e86e563c228a0f82f1d5f6989dd952.tar.xz frr-c54142bb84e86e563c228a0f82f1d5f6989dd952.zip |
tools: Catch argv_find() cases when testing only the index
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/coccinelle/argv_find.cocci | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/coccinelle/argv_find.cocci b/tools/coccinelle/argv_find.cocci new file mode 100644 index 000000000..f13b035d7 --- /dev/null +++ b/tools/coccinelle/argv_find.cocci @@ -0,0 +1,16 @@ +@@ +identifier idx; +identifier argv; +identifier argc; +expression e1; +expression e2; +@@ + +- argv_find(argv, argc, e1, &idx); + if ( +- idx ++ argv_find(argv, argc, e1, &idx) + ) + { + e2; + } |