summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/contrib')
-rw-r--r--apt-pkg/contrib/fileutl.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc
index 4347c55ad..004df3fe8 100644
--- a/apt-pkg/contrib/fileutl.cc
+++ b/apt-pkg/contrib/fileutl.cc
@@ -968,9 +968,9 @@ struct APT_HIDDEN simple_buffer { /*{{{*/
}
ssize_t write(const void *from, unsigned long long requested_size) APT_MUSTCHECK
{
- if (buffersize_max - size() < requested_size)
- requested_size = buffersize_max - size();
- memcpy(buffer + bufferend, from, requested_size);
+ if (free() < requested_size)
+ requested_size = free();
+ memcpy(getend(), from, requested_size);
bufferend += requested_size;
if (bufferstart == bufferend)
bufferstart = bufferend = 0;