]> git.saurik.com Git - apt.git/commitdiff
StartPos is always positive for http/https
authorDavid Kalnischkies <david@kalnischkies.de>
Thu, 27 Feb 2014 00:26:29 +0000 (01:26 +0100)
committerDavid Kalnischkies <david@kalnischkies.de>
Thu, 13 Mar 2014 12:58:45 +0000 (13:58 +0100)
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
methods/server.h

index 16c6d19e131391bc94acb83e9011b9eedf281fb8..e1bb2e13061e45b937420bed6f5eb9d8ee89eba2 100644 (file)
@@ -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()                                  /*{{{*/
index f1db9adf7f314a6a47bd73d8ecc5f91ccf7586cf..b4870698f205a7307be4ef6fc2f2e2f81070d55e 100644 (file)
@@ -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;