Fix issues reported by coverity

pull/629/head
Tatsuhiro Tsujikawa 2016-04-13 19:20:19 +09:00
parent 59c625b1fd
commit ce868d75bd
2 changed files with 3 additions and 4 deletions

View File

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

View File

@ -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) bool parseLLIntNoThrow(int64_t& res, const std::string& s, int base)
{ {
long long int t; int64_t t;
if (parseLong(t, strtoll, s, base) && if (parseLong(t, strtoll, s, base)) {
t >= std::numeric_limits<int64_t>::min() &&
t <= std::numeric_limits<int64_t>::max()) {
res = t; res = t;
return true; return true;
} }