Advertisement
PVS-StudioWarnings

PVS-Studio warning V600 for Notepad++

Nov 27th, 2014
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.70 KB | None | 0 0
  1. LRESULT Notepad_plus::process(
  2.   HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
  3. {
  4.   ...
  5.   TCHAR mainVerStr[16];
  6.   TCHAR auxVerStr[16];
  7.   ...
  8.   if (mainVerStr)
  9.     mainVer = generic_atoi(mainVerStr);
  10.   if (auxVerStr)
  11.     auxVer = generic_atoi(auxVerStr);
  12.   ...
  13. }
  14.  
  15. Unnecessary checks.
  16.  
  17.  
  18. This suspicious code was found in Notepad++ project by PVS-Studio static code analyzer.
  19. Warning message is:
  20. V600 Consider inspecting the condition. The 'mainVerStr' pointer is always not equal to NULL.  Notepad++  nppbigswitch.cpp  938
  21.  
  22. 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