aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@gnome.org>2004-09-21 17:18:15 +0800
committerMarco Pesenti Gritti <marco@src.gnome.org>2004-09-21 17:18:15 +0800
commit68fceef26a1df7956a5557b39c3ea2ba64a6b986 (patch)
tree8837ae7056a865ec9fc825dfb669352de71bc52b
parent283517d148beb279e2610119f0da9909740e7f81 (diff)
downloadgsoc2013-epiphany-68fceef26a1df7956a5557b39c3ea2ba64a6b986.tar
gsoc2013-epiphany-68fceef26a1df7956a5557b39c3ea2ba64a6b986.tar.gz
gsoc2013-epiphany-68fceef26a1df7956a5557b39c3ea2ba64a6b986.tar.bz2
gsoc2013-epiphany-68fceef26a1df7956a5557b39c3ea2ba64a6b986.tar.lz
gsoc2013-epiphany-68fceef26a1df7956a5557b39c3ea2ba64a6b986.tar.xz
gsoc2013-epiphany-68fceef26a1df7956a5557b39c3ea2ba64a6b986.tar.zst
gsoc2013-epiphany-68fceef26a1df7956a5557b39c3ea2ba64a6b986.zip
Fix overflow in remaining time calculation. Fix bug #153136. Thanks to
2004-09-21 Marco Pesenti Gritti <marco@gnome.org> * embed/ephy-download.c: (update_remaining_time): Fix overflow in remaining time calculation. Fix bug #153136. Thanks to Jhon Spray for tracking this.
-rw-r--r--ChangeLog7
-rw-r--r--embed/ephy-download.c5
2 files changed, 11 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 6df8b87c1..de4a0d55f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2004-09-21 Marco Pesenti Gritti <marco@gnome.org>
+
+ * 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 Marco Pesenti Gritti <marco@gnome.org>
reviewed by: Christian Persch <chpe@cvs.gnome.org>
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);
}
}