Advertisement
PVS-StudioWarnings

PVS-Studio warning V620 for Snes9x

Nov 27th, 2014
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.63 KB | None | 0 0
  1. typedef wchar_t TCHAR;
  2.  
  3. INT_PTR CALLBACK DlgOpenROMProc(....)
  4. {
  5.   ....
  6.   TCHAR *tmp, *tmp2;
  7.   ....
  8.   while(tmp2=_tcsstr(tmp, TEXT("\\")))
  9.     tmp=tmp2+sizeof(TCHAR);
  10.   ....
  11. }
  12.  
  13. Most likely this is what should be written here: tmp=tmp2+1;
  14.  
  15. This suspicious code was found in Snes9x project by PVS-Studio static code analyzer.
  16. Warning message is:
  17. V620 It's unusual that the expression of sizeof(T) kind is being summed with the pointer to T type. wsnes9x.cpp 6145
  18.  
  19. 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