PVS-StudioWarnings

PVS-Studio warning V547 for Firefox

Nov 20th, 2014
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 KB | None | 0 0
  1. int
  2. PatchFile::LoadSourceFile(FILE* ofile)
  3. {
  4.   ...
  5.   size_t c = fread(rb, 1, r, ofile);
  6.   if (c < 0) {
  7.     LOG(("LoadSourceFile: error reading destination file: "
  8.          LOG_S "\n", mFile));
  9.     return READ_ERROR;
  10.   }
  11.   ...
  12. }
  13.  
  14. This suspicious code was found in Firefox project by PVS-Studio static code analyzer.
  15. Warning message is:
  16. V547 Expression 'c < 0' is always false. Unsigned type value is never < 0. updater.cpp 1179
  17.  
  18. 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