]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/contrib/hashes.cc
disable https->http redirects in libcurl
[apt.git] / apt-pkg / contrib / hashes.cc
index b4c768db97d193e1c4dc01926341c52105cc3287..890573d9cd9858330a188fc5536605341f7deacb 100644 (file)
@@ -129,13 +129,12 @@ bool Hashes::AddFD(int const Fd,unsigned long long Size, bool const addMD5,
                   bool const addSHA1, bool const addSHA256, bool const addSHA512)
 {
    unsigned char Buf[64*64];
-   ssize_t Res = 0;
-   int ToEOF = (Size == 0);
+   bool const ToEOF = (Size == 0);
    while (Size != 0 || ToEOF)
    {
       unsigned long long n = sizeof(Buf);
       if (!ToEOF) n = std::min(Size, n);
-      Res = read(Fd,Buf,n);
+      ssize_t const Res = read(Fd,Buf,n);
       if (Res < 0 || (!ToEOF && Res != (ssize_t) n)) // error, or short read
         return false;
       if (ToEOF && Res == 0) // EOF