From: David Kalnischkies Date: Thu, 27 Feb 2014 00:26:29 +0000 (+0100) Subject: StartPos is always positive for http/https X-Git-Tag: 0.9.16~2^2~38 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/3de8f956d5fcf023ab65f88579cd77121694d872 StartPos is always positive for http/https server.cc: In member function ‘bool ServerState::HeaderLine(std::string)’: server.cc:198:72: warning: format ‘%llu’ expects argument of type ‘long long unsigned int*’, but argument 3 has type ‘long long int*’ [-Wformat=] else if (sscanf(Val.c_str(),"bytes %llu-%*u/%llu",&StartPos,&Size) != 2) Git-Dch: Ignore Reported-By: gcc -Wpedantic --- diff --git a/methods/http.cc b/methods/http.cc index 16c6d19e1..e1bb2e130 100644 --- a/methods/http.cc +++ b/methods/http.cc @@ -484,13 +484,8 @@ bool HttpServerState::InitHashes(FileFd &File) /*{{{*/ In.Hash = new Hashes; // Set the expected size and read file for the hashes - if (StartPos >= 0) - { - File.Truncate(StartPos); - - return In.Hash->AddFD(File, StartPos); - } - return true; + File.Truncate(StartPos); + return In.Hash->AddFD(File, StartPos); } /*}}}*/ Hashes * HttpServerState::GetHashes() /*{{{*/ diff --git a/methods/server.h b/methods/server.h index f1db9adf7..b4870698f 100644 --- a/methods/server.h +++ b/methods/server.h @@ -32,7 +32,7 @@ struct ServerState // These are some statistics from the last parsed header lines unsigned long long Size; - signed long long StartPos; + unsigned long long StartPos; time_t Date; bool HaveContent; enum {Chunked,Stream,Closes} Encoding;