summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/fileutl.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2015-12-28 04:09:55 +0100
committerJulian Andres Klode <jak@debian.org>2015-12-28 04:10:37 +0100
commit80f06991967d4daccb1c0c1147a6e16291ebb027 (patch)
treeba385ae12f637463c06fd10072c47d1536d8d235 /apt-pkg/contrib/fileutl.cc
parent2ffd35359fffac0ae9ac1def06237324b7204c97 (diff)
BufferedWriter: flushing: Check for written < size instead of <=
This avoids some issues with InternalWrite returning 0 because it just cannot write stuff at the moment.
Diffstat (limited to 'apt-pkg/contrib/fileutl.cc')
-rw-r--r--apt-pkg/contrib/fileutl.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc
index 71dfc83a2..0c5d76290 100644
--- a/apt-pkg/contrib/fileutl.cc
+++ b/apt-pkg/contrib/fileutl.cc
@@ -1222,12 +1222,10 @@ public:
char *data = writebuffer.get();
auto size = writebuffer.size();
- while (written <= size) {
+ while (written < size) {
auto written_this_time = wrapped->InternalWrite(data + written, size - written);
if (written_this_time < 0)
return false;
- if (written_this_time == 0)
- break;
written += written_this_time;
}