PVS-StudioWarnings

PVS-Studio warning V547 for DeSmuME

Nov 17th, 2014
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. class CHEATSEXPORT
  2. {
  3.   ...
  4.   u8 *gametitle;
  5.   ...
  6. }
  7.  
  8. INT_PTR CALLBACK CheatsExportProc(HWND dialog, UINT msg,
  9.                                   WPARAM wparam, LPARAM lparam)
  10. {
  11.   ...
  12.   if ((char*)cheatsExport->gametitle != "")
  13.   ...
  14. }
  15.  
  16. This suspicious code was found in DeSmuME project by PVS-Studio static code analyzer.
  17. Warning message is:
  18. V547 Expression '(char *) cheatsExport->gametitle != ""' is always true. To compare strings you should use strcmp() function. DeSmuME_VS2005 cheatswin.cpp 1382
  19.  
  20. 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