Advertisement
PVS-StudioWarnings

PVS-Studio warning V501 for VirtualBox

Nov 21st, 2014
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.95 KB | None | 0 0
  1. QString UIWizardExportApp::uri(bool fWithFile) const
  2. {
  3.   ....
  4.   case SunCloud:
  5.   {
  6.     ...
  7.     QString uri("SunCloud://");
  8.     ....
  9.     if (!field("username").toString().isEmpty() ||  //<==
  10.         !field("username").toString().isEmpty())    //<==
  11.       uri = QString("%1@").arg(uri);
  12.     ....
  13.   }
  14.   case S3:
  15.   {
  16.     QString uri("S3://");
  17.     ....
  18.     if (!field("username").toString().isEmpty() ||
  19.         !field("password").toString().isEmpty())
  20.       uri = QString("%1@").arg(uri);
  21.     ....
  22.   }
  23.   ....
  24. }
  25.  
  26. This suspicious code was found in VirtualBox project by PVS-Studio static code analyzer.
  27. Warning message is:
  28. V501 There are identical sub-expressions '!field("username").toString().isEmpty()' to the left and to the right of the '||' operator. uiwizardexportapp.cpp 177
  29.  
  30. 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