Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void MascotConverter::init(....) {
- ...
- if(line_len > 8 && line[0] == 'r' && line[1] == 'e' &&
- line[2] == 'l' && line[3] == 'e' && line[4] == 'a' &&
- line[5] == 's' && line[6] == 'e' && line[7] == '=')
- if(database_ == NULL)
- database_ = strCopy(line+8);
- else if(line_len > 5 && line[0] == 'F' && line[1] == 'I' &&
- line[2] == 'L' && line[3] == 'E' && line[4] == '=') {
- header_ = strCopy(line+5);
- ...
- }
- Because there are no parentheses, else refers to another if.
- This suspicious code was found in TPP project by PVS-Studio static code analyzer.
- Warning message is:
- V563 It is possible that this 'else' branch must apply to the previous 'if' statement. Mascot2XML mascotconverter.cxx 895
- 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