Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void
- vbcppProcessSkipWhiteAndEscapedEol(PSCMSTREAM pStrmInput)
- {
- ....
- if (ch == '\r' || ch == '\n')
- {
- ....
- }
- else if (RT_C_IS_SPACE(ch))
- {
- ch = chPrev; //<==
- ch = ScmStreamGetCh(pStrmInput); //<==
- Assert(ch == chPrev);
- }
- else
- break;
- ....
- }
- It is logical to assume that the operands of the assignment operator are swapped by mistake and it is the previous character that should be saved in this code: chPrev = ch;
- This suspicious code was found in VirtualBox project by PVS-Studio static code analyzer.
- Warning message is:
- V519 The 'ch' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 1135, 1136. vboxcpp.cpp 1136
- 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