From 695c95a8a47d6d2c1092bd6a379743d3939961bc Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Tue, 21 Sep 2004 09:16:17 +0000 Subject: Fix overflow in remaining time calculation. Fix bug #153136. Thanks to 2004-09-21 Marco Pesenti Gritti * embed/ephy-download.c: (update_remaining_time): Fix overflow in remaining time calculation. Fix bug #153136. Thanks to Jhon Spray for tracking this. --- ChangeLog | 7 +++++++ embed/ephy-download.c | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 476e1babe..560577ba1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-09-21 Marco Pesenti Gritti + + * embed/ephy-download.c: (update_remaining_time): + + Fix overflow in remaining time calculation. Fix bug + #153136. Thanks to Jhon Spray for tracking this. + 2004-09-18 Christian Persch * embed/downloader-view.c: (progress_cell_data_func): diff --git a/embed/ephy-download.c b/embed/ephy-download.c index c4165b25d..ee1a0154f 100644 --- a/embed/ephy-download.c +++ b/embed/ephy-download.c @@ -150,7 +150,10 @@ update_remaining_time (EphyDownload *download) if (cur > 0) { - download->priv->remaining_time = elapsed_time * (total - cur) / cur; + float per_byte_time; + + per_byte_time = (float)elapsed_time / (float)cur; + download->priv->remaining_time = time_per_byte * (total - cur); } } -- cgit v1.2.3