Преглед изворни кода

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
David Kalnischkies пре 12 година
родитељ
комит
3de8f956d5
2 измењених фајлова са 3 додато и 8 уклоњено
  1. 2 7
      methods/http.cc
  2. 1 1
      methods/server.h

+ 2 - 7
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()					/*{{{*/

+ 1 - 1
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;