From: Julian Andres Klode Date: Thu, 4 Feb 2016 17:33:30 +0000 (+0100) Subject: Use some semantically more correct buffer operations X-Git-Tag: 1.2.2~1 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/72ed5f14b558984bd9c5731f82345b10cb2df2ca?ds=inline Use some semantically more correct buffer operations When writing into the buffer write to free() bytes starting at getend(), instead of buffersize_max bytes at get() -> get() is a read pointer. This makes no difference in practice though, as we reset the buffer before the call, so start = end = 0. Gbp-Dch: ignore --- diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index fcdaee644..297172eea 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -1054,7 +1054,7 @@ public: { buffer.reset(); unsigned long long actualread = 0; - if (filefd->Read(buffer.get(), buffer.buffersize_max, &actualread) == false) + if (filefd->Read(buffer.getend(), buffer.free(), &actualread) == false) return nullptr; buffer.bufferend = actualread; if (buffer.size() == 0)