Advertisement
PVS-StudioWarnings

PVS-Studio warning V523 for WinMerge

Nov 10th, 2014
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.81 KB | None | 0 0
  1. if (max < INT_MAX)
  2. {
  3.   for (i = min; i < max; i++)
  4.   {
  5.     if (eptr >= md->end_subject ||
  6.         IS_NEWLINE(eptr))
  7.       break;
  8.     eptr++;
  9.     while (eptr < md->end_subject &&
  10.            (*eptr & 0xc0) == 0x80)
  11.       eptr++;
  12.     }
  13.   }
  14. else
  15. {
  16.   for (i = min; i < max; i++)
  17.   {
  18.     if (eptr >= md->end_subject ||
  19.         IS_NEWLINE(eptr))
  20.       break;
  21.     eptr++;
  22.     while (eptr < md->end_subject &&
  23.            (*eptr & 0xc0) == 0x80)
  24.       eptr++;
  25.     }
  26.   }
  27. }
  28.  
  29. This suspicious code was found in WinMerge project by PVS-Studio static code analyzer.
  30. Warning message is:
  31. V523 The 'then' statement is equivalent to the 'else' statement
  32.  
  33. 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