summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/contrib')
-rw-r--r--apt-pkg/contrib/fileutl.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc
index 86ca82cff..1ffa407bc 100644
--- a/apt-pkg/contrib/fileutl.cc
+++ b/apt-pkg/contrib/fileutl.cc
@@ -165,7 +165,7 @@ bool CopyFile(FileFd &From,FileFd &To)
unsigned long long ToRead = 0;
do {
if (From.Read(Buf.get(),BufSize, &ToRead) == false ||
- To.Write(Buf.get(),ToRead) == false)
+ (ToRead > 0 && To.Write(Buf.get(),ToRead) == false))
return false;
} while (ToRead != 0);