Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void check_pval_item(pval *item, ....)
- {
- ....
- if (strcasecmp(item->u1.str,"GotoIf") == 0
- || strcasecmp(item->u1.str,"GotoIfTime") == 0
- || strcasecmp(item->u1.str,"while") == 0
- || strcasecmp(item->u1.str,"endwhile") == 0 //<==
- || strcasecmp(item->u1.str,"random") == 0
- || strcasecmp(item->u1.str,"gosub") == 0
- || strcasecmp(item->u1.str,"gosubif") == 0
- || strcasecmp(item->u1.str,"continuewhile") == 0
- || strcasecmp(item->u1.str,"endwhile") == 0 //<==
- || strcasecmp(item->u1.str,"execif") == 0
- || ....)
- {....}
- }
- This suspicious code was found in Asterisk project by PVS-Studio static code analyzer.
- Warning message is:
- V501 There are identical sub-expressions 'strcasecmp(item->u1.str, "endwhile") == 0' to the left and to the right of the '||' operator. pval.c 2513
- PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement