Advertisement
PVS-StudioWarnings

PVS-Studio warning V563 for peerblock

Nov 26th, 2014
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.68 KB | None | 0 0
  1. static void EditList_OnCommand(....)
  2. {
  3.   ...
  4.   if(l=dynamic_cast<StaticList*>(*list))
  5.     if(l->File!=file) {
  6.       l->File=file;
  7.       g_ret|=LISTS_NEEDRELOAD;
  8.     }
  9.   else {
  10.     delete *list;
  11.     *list=l=new StaticList;
  12.     l->File=file;
  13.     g_ret|=LISTS_NEEDRELOAD;
  14.   }
  15.   ...
  16. }
  17.  
  18. This suspicious code was found in peerblock project by PVS-Studio static code analyzer.
  19. Warning message is:
  20. V563 It is possible that this 'else' branch must apply to the previous 'if' statement. peerblock editlistproc.cpp 91
  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