PVS-StudioWarnings

PVS-Studio warning V547 for TortoiseGIT

Nov 19th, 2014
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.65 KB | None | 0 0
  1. void CCloneDlg::OnBnClickedCheckSvn()
  2. {
  3.   ....
  4.   CString str;
  5.   m_URLCombo.GetWindowText(str);
  6.  
  7.   while(str.GetLength()>=1 &&
  8.         str[str.GetLength()-1] == _T('\\') &&
  9.         str[str.GetLength()-1] == _T('/'))
  10.   {
  11.     str=str.Left(str.GetLength()-1);
  12.   }
  13.   ....
  14. }
  15.  
  16. This suspicious code was found in TortoiseGIT project by PVS-Studio static code analyzer.
  17. Warning message is:
  18. V547 Expression is always false. Probably the '||' operator should be used here. clonedlg.cpp 413
  19.  
  20. 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