diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2011-08-09 14:52:13 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2011-08-09 14:52:13 +0200 |
commit | 7c9ff7fbd8dcc663713af75fd5d24b72dbcfe77f (patch) | |
tree | aa5e90e26d12e6cc9e7b8ae66128336e28fbe9a0 | |
parent | e8df63018fa0e4246b493ad95321b7f3c8ca0bcc (diff) |
* apt-pkg/acquire.cc:
- fix potential divide-by-zero
-rw-r--r-- | apt-pkg/acquire.cc | 4 | ||||
-rw-r--r-- | debian/changelog | 7 |
2 files changed, 10 insertions, 1 deletions
diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc index 2064abc50..06b0f11f8 100644 --- a/apt-pkg/acquire.cc +++ b/apt-pkg/acquire.cc @@ -849,7 +849,9 @@ bool pkgAcquireStatus::Pulse(pkgAcquire *Owner) char msg[200]; long i = CurrentItems < TotalItems ? CurrentItems + 1 : CurrentItems; - unsigned long long const ETA = (TotalBytes - CurrentBytes) / CurrentCPS; + unsigned long long ETA = 0; + if(CurrentCPS > 0) + ETA = (TotalBytes - CurrentBytes) / CurrentCPS; // only show the ETA if it makes sense if (ETA > 0 && ETA < 172800 /* two days */ ) diff --git a/debian/changelog b/debian/changelog index 8ea1ee32e..59434546b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +apt (0.8.16~exp5ubuntu3) UNRELEASEDoneiric; urgency=low + + * apt-pkg/acquire.cc: + - fix potential divide-by-zero + + -- Michael Vogt <michael.vogt@ubuntu.com> Tue, 09 Aug 2011 14:51:07 +0200 + apt (0.8.16~exp5ubuntu2) oneiric; urgency=low * test/integration/test-hashsum-verification: |