PVS-StudioWarnings

PVS-Studio warning V547 for WinMerge

Nov 20th, 2014
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.63 KB | None | 0 0
  1. BOOL CCrystalEditView::
  2. DoDropText (COleDataObject * pDataObject,
  3.             const CPoint & ptClient)
  4. {
  5.   ...
  6.   UINT cbData = (UINT) ::GlobalSize (hData);
  7.   UINT cchText = cbData / sizeof(TCHAR) - 1;
  8.   if (cchText < 0)
  9.     return FALSE;
  10.   ...
  11. }
  12.  
  13. This suspicious code was found in WinMerge project by PVS-Studio static code analyzer.
  14. Warning message is:
  15. V547 Expression 'cchText < 0' is always false. Unsigned type value is never < 0. Merge ccrystaleditview.cpp 1135
  16.  
  17. 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