summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/contrib')
-rw-r--r--apt-pkg/contrib/fileutl.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc
index 0d1c272ab..c906a0c9e 100644
--- a/apt-pkg/contrib/fileutl.cc
+++ b/apt-pkg/contrib/fileutl.cc
@@ -1506,12 +1506,12 @@ FileFd::~FileFd()
gracefully. */
bool FileFd::Read(void *To,unsigned long long Size,unsigned long long *Actual)
{
- ssize_t Res;
+ ssize_t Res = 1;
errno = 0;
if (Actual != 0)
*Actual = 0;
*((char *)To) = '\0';
- do
+ while (Res > 0 && Size > 0)
{
if (false)
/* dummy so that the rest can be 'else if's */;
@@ -1605,7 +1605,6 @@ bool FileFd::Read(void *To,unsigned long long Size,unsigned long long *Actual)
if (Actual != 0)
*Actual += Res;
}
- while (Res > 0 && Size > 0);
if (Size == 0)
return true;