PVS-StudioWarnings

PVS-Studio warning V559 for Miranda IM

Nov 11th, 2014
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. int __cdecl CIcqProto::FileCancel( ... )
  2. {
  3.   ...
  4.   if (dwUin && ft->ft_magic == FT_MAGIC_ICQ)
  5.   {
  6.     ...
  7.   }
  8.   else if (ft->ft_magic = FT_MAGIC_OSCAR)
  9.   {
  10.     ...
  11.   }
  12.   ...
  13. }
  14.  
  15. This is what should have been written here: else if (ft->ft_magic == FT_MAGIC_OSCAR)
  16.  
  17. This suspicious code was found in Miranda IM project by PVS-Studio static code analyzer.
  18. Warning message is:
  19. V559 Suspicious assignment inside the condition expression of 'if' operator: ft->ft_magic = 0x4F. icqoscar8 icq_proto.cpp 666
  20.  
  21. 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