Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void
- sttRegisterToolBarButton(..., char * pszButtonName, ...)
- {
- ...
- if ((BYTE)pszButtonName)
- tbb.tbbFlags=TBBF_FLEXSIZESEPARATOR;
- else
- tbb.tbbFlags=TBBF_ISSEPARATOR;
- ...
- }
- This code is suspicious. In fact, we check that the string address is multiple of 256. But what the programmer actually wanted to write in the condition is a mystery. I'm not sure that this is exactly an error. There are similar games with pointers - that is, something else is stored in pointers. This code should be cited simply as an example of a suspicious code fragment that needs checking.
- This suspicious code was found in Miranda IM project by PVS-Studio static code analyzer.
- Warning message is:
- V542 Consider inspecting an odd type cast: 'char *' to 'char'. clist_modern modern_toolbar.cpp 586
- 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