Переглянути джерело

Fix issues reported by coverity

Tatsuhiro Tsujikawa 9 роки тому
батько
коміт
ce868d75bd
2 змінених файлів з 3 додано та 4 видалено
  1. 1 0
      src/DownloadResult.cc
  2. 2 4
      src/util.cc

+ 1 - 0
src/DownloadResult.cc

@@ -46,6 +46,7 @@ DownloadResult::DownloadResult()
       totalLength(0),
       completedLength(0),
       uploadLength(0),
+      following(0),
       numPieces(0),
       pieceLength(0),
       result(error_code::UNDEFINED),

+ 2 - 4
src/util.cc

@@ -586,10 +586,8 @@ bool parseUIntNoThrow(uint32_t& res, const std::string& s, int base)
 
 bool parseLLIntNoThrow(int64_t& res, const std::string& s, int base)
 {
-  long long int t;
-  if (parseLong(t, strtoll, s, base) &&
-      t >= std::numeric_limits<int64_t>::min() &&
-      t <= std::numeric_limits<int64_t>::max()) {
+  int64_t t;
+  if (parseLong(t, strtoll, s, base)) {
     res = t;
     return true;
   }