From b83acf88c1beaf3afd8967e454f850c57d2cf4e1 Mon Sep 17 00:00:00 2001 From: hniksic Date: Thu, 27 Nov 2003 14:59:36 -0800 Subject: [PATCH] [svn] Don't calculate the ETA if nothing has yet been downloaded. --- src/ChangeLog | 5 +++++ src/progress.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index a077cd68..c0ebba2d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2003-11-27 Hrvoje Niksic + + * progress.c (create_image): Don't calculate ETA if nothing has + been downloaded yet, because it causes division by zero. + 2003-11-27 Hrvoje Niksic * connect.c (bind_local): Rename sa_len to addrlen because IRIX diff --git a/src/progress.c b/src/progress.c index 3497bff2..33ccb7c9 100644 --- a/src/progress.c +++ b/src/progress.c @@ -850,7 +850,7 @@ create_image (struct bar_progress *bp, double dl_total_time) /* " ETA xx:xx:xx"; wait for three seconds before displaying the ETA. That's because the ETA value needs a while to become reliable. */ - if (bp->total_length > 0 && dl_total_time > 3000) + if (bp->total_length > 0 && bp->count > 0 && dl_total_time > 3000) { long eta; int eta_hrs, eta_min, eta_sec; -- 2.39.2