From 3de8f956d5fcf023ab65f88579cd77121694d872 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 27 Feb 2014 01:26:29 +0100 Subject: [PATCH] StartPos is always positive for http/https MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- methods/http.cc | 9 ++------- methods/server.h | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/methods/http.cc b/methods/http.cc index 16c6d19e..e1bb2e13 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 f1db9adf..b4870698 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; -- 2.20.1