aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--filter/ChangeLog5
-rw-r--r--filter/filter-driver.c6
2 files changed, 9 insertions, 2 deletions
diff --git a/filter/ChangeLog b/filter/ChangeLog
index ffbb45ebc1..0c62078bdd 100644
--- a/filter/ChangeLog
+++ b/filter/ChangeLog
@@ -1,3 +1,8 @@
+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.
+
2000-10-27 Christopher James Lahey <clahey@helixcode.com>
* Makefile.am: Fixed this to include EXTRA_GNOME_CFLAGS.
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 ();