PVS-StudioWarnings

PVS-Studio warning V637 for TortoiseGIT

Nov 20th, 2014
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.79 KB | None | 0 0
  1. svn_error_t *
  2. svn_mergeinfo__adjust_mergeinfo_rangelists(....)
  3. {
  4.   ....
  5.   if (range->start + offset > 0 && range->end + offset > 0)
  6.   {
  7.     if (range->start + offset < 0)
  8.       range->start = 0;
  9.     else
  10.       range->start = range->start + offset;
  11.  
  12.     if (range->end + offset < 0)
  13.       range->end = 0;
  14.     else
  15.       range->end = range->end + offset;
  16.   ....
  17. }
  18.  
  19. This suspicious code was found in TortoiseGIT project by PVS-Studio static code analyzer.
  20. Warning message is:
  21. V637 Two opposite conditions were encountered. The second condition is always false. Check lines: 2464, 2466. TortoiseGitMerge mergeinfo.c 2464
  22.  
  23. 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