PVS-StudioWarnings

PVS-Studio warning V517 for Wine

Nov 13th, 2014
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.04 KB | None | 0 0
  1. UINT WINAPI MsiGetPatchInfoExW(....LPCWSTR szProperty....)
  2. {
  3.   if(!strcmpW( szProperty, INSTALLPROPERTY_LOCALPACKAGEW)) //<==
  4.   {
  5.     ...
  6.   }
  7.   else if (!strcmpW( szProperty, INSTALLPROPERTY_INSTALLDATEW ))
  8.   {
  9.     ...
  10.   }
  11.   else
  12.   if(!strcmpW( szProperty, INSTALLPROPERTY_LOCALPACKAGEW)) //<==
  13.   {
  14.     ...
  15.   }
  16.   else if(!strcmpW(szProperty,INSTALLPROPERTY_UNINSTALLABLEW) ||
  17.           !strcmpW( szProperty, INSTALLPROPERTY_PATCHSTATEW ) ||
  18.           !strcmpW( szProperty, INSTALLPROPERTY_DISPLAYNAMEW ) ||
  19.           !strcmpW( szProperty, INSTALLPROPERTY_MOREINFOURLW ))
  20.   {
  21.     ...
  22.   }
  23.   else
  24.   {
  25.     ...
  26.   }
  27. }
  28.  
  29. This suspicious code was found in Wine project by PVS-Studio static code analyzer.
  30. Warning message is:
  31. V517 The use of 'if (A) {...} else if (A) {...}' pattern was detected. There is a probability of logical error presence. Check lines: 1754, 1765. msi.c 1754
  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