aboutsummaryrefslogtreecommitdiffstats
path: root/filter/filter-driver.c
diff options
context:
space:
mode:
authorJacob "Ulysses" Berkman <jacob@helixcode.com>2000-10-28 03:14:14 +0800
committerJacob Berkman <jberkman@src.gnome.org>2000-10-28 03:14:14 +0800
commit81a3b9a47a5429c12947d6dde429ad6f6648337c (patch)
treec06457731e15e5d8f90152944c3776609801cdf4 /filter/filter-driver.c
parent4edb2c4651a6efb370cadb79a2bd7624d7a2a09c (diff)
downloadgsoc2013-evolution-81a3b9a47a5429c12947d6dde429ad6f6648337c.tar.gz
gsoc2013-evolution-81a3b9a47a5429c12947d6dde429ad6f6648337c.tar.zst
gsoc2013-evolution-81a3b9a47a5429c12947d6dde429ad6f6648337c.zip
divide before multiple so that we don't overflow.
2000-10-27 Jacob "Ulysses" Berkman <jacob@helixcode.com> * filter-driver.c (filter_driver_filter_mbox): divide before multiple so that we don't overflow. svn path=/trunk/; revision=6235
Diffstat (limited to 'filter/filter-driver.c')
-rw-r--r--filter/filter-driver.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/filter/filter-driver.c b/filter/filter-driver.c
index 0a5ecc0561..f9e893a32b 100644
--- a/filter/filter-driver.c
+++ b/filter/filter-driver.c
@@ -540,9 +540,11 @@ filter_driver_filter_mbox (FilterDriver *driver, const char *mbox, const char *s
while (camel_mime_parser_step (mp, 0, 0) == HSCAN_FROM) {
CamelMimeMessage *msg;
- int pc;
+ int pc = 0;
- pc = camel_mime_parser_tell (mp) * 100 / st.st_size;
+ if (st.st_size > 0)
+ pc = (int)(100.0 * ((double)camel_mime_parser_tell (mp) / (double)st.st_size));
+
report_status (driver, FILTER_STATUS_START, "Getting message %d (%d%% of file)", i, pc);
msg = camel_mime_message_new ();