]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/contrib/hashes.cc
* merged from apt--mvo
[apt.git] / apt-pkg / contrib / hashes.cc
index af741b67278b671385070ea0e1f5d19253299028..b725e94187faa00f352eab71676fb2753e60522d 100644 (file)
    ##################################################################### */
                                                                        /*}}}*/
 // Include Files                                                       /*{{{*/
-#ifdef __GNUG__
-#pragma implementation "apt-pkg/hashes.h"
-#endif
-
 #include <apt-pkg/hashes.h>
     
 #include <unistd.h>    
@@ -30,12 +26,13 @@ bool Hashes::AddFD(int Fd,unsigned long Size)
    int Res = 0;
    while (Size != 0)
    {
-      Res = read(Fd,Buf,MIN(Size,sizeof(Buf)));
-      if (Res < 0 || (unsigned)Res != MIN(Size,sizeof(Buf)))
+      Res = read(Fd,Buf,min(Size,(unsigned long)sizeof(Buf)));
+      if (Res < 0 || (unsigned)Res != min(Size,(unsigned long)sizeof(Buf)))
         return false;
       Size -= Res;
       MD5.Add(Buf,Res);
       SHA1.Add(Buf,Res);
+      SHA256.Add(Buf,Res);
    }
    return true;
 }