From 1dab797ca6dc0357474675a0f132c962dee4a2c2 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 13 Jul 2011 23:10:38 +0200 Subject: enable Hashes::AddFD() to skip creation of certain hashes --- apt-pkg/contrib/hashsum.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'apt-pkg/contrib/hashsum.cc') diff --git a/apt-pkg/contrib/hashsum.cc b/apt-pkg/contrib/hashsum.cc index b97eaf831..728747d7a 100644 --- a/apt-pkg/contrib/hashsum.cc +++ b/apt-pkg/contrib/hashsum.cc @@ -10,11 +10,10 @@ bool SummationImplementation::AddFD(int const Fd, unsigned long Size) { unsigned char Buf[64 * 64]; int Res = 0; int ToEOF = (Size == 0); - unsigned long n = sizeof(Buf); - if (!ToEOF) - n = std::min(Size, n); while (Size != 0 || ToEOF) { + unsigned n = sizeof(Buf); + if (!ToEOF) n = min(Size,(unsigned long)n); Res = read(Fd, Buf, n); if (Res < 0 || (!ToEOF && (unsigned) Res != n)) // error, or short read return false; -- cgit v1.2.3-70-g09d2