]> git.saurik.com Git - apt.git/commitdiff
Use some semantically more correct buffer operations
authorJulian Andres Klode <jak@debian.org>
Thu, 4 Feb 2016 17:33:30 +0000 (18:33 +0100)
committerJulian Andres Klode <jak@debian.org>
Thu, 4 Feb 2016 17:34:42 +0000 (18:34 +0100)
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

apt-pkg/contrib/fileutl.cc

index fcdaee644b6d44bf72692b0c922e165b350bd40a..297172eead3c81330778c17d980e5454bb5aa0be 100644 (file)
@@ -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)