From c033d41504957ed04d64ec72e7f47dfac64218b5 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 9 Aug 2011 14:50:20 +0200 Subject: * apt-pkg/acquire.cc: - fix potential divide-by-zero --- apt-pkg/acquire.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'apt-pkg/acquire.cc') 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 */ ) -- cgit v1.2.3