PVS-StudioWarnings

PVS-Studio warning V530 for InstantVNC

Nov 20th, 2014
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. struct ST_DATA
  2. {
  3.   ...
  4.   std::string m_szImagePath;
  5.   ...
  6. };
  7.  
  8. void Install_and_Run_MainFiles(const char* szPath)
  9. {
  10.   ...
  11.   if (!WriteTmpBanner(ser, szPath))
  12.   {
  13.     ser.m_data.m_szImagePath.empty();
  14.   }
  15.   ...
  16. }
  17.  
  18. This is what should have been written here: ser.m_data.m_szImagePath.clear();
  19.  
  20. This suspicious code was found in InstantVNC project by PVS-Studio static code analyzer.
  21. Warning message is:
  22. V530 The return value of function 'empty' is required to be utilized. AskParameter wndproc.cpp 163
  23.  
  24. 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