From 81a3b9a47a5429c12947d6dde429ad6f6648337c Mon Sep 17 00:00:00 2001 From: "Jacob \"Ulysses\" Berkman" Date: Fri, 27 Oct 2000 19:14:14 +0000 Subject: divide before multiple so that we don't overflow. 2000-10-27 Jacob "Ulysses" Berkman * filter-driver.c (filter_driver_filter_mbox): divide before multiple so that we don't overflow. svn path=/trunk/; revision=6235 --- filter/ChangeLog | 5 +++++ filter/filter-driver.c | 6 ++++-- 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 + + * filter-driver.c (filter_driver_filter_mbox): divide before + multiple so that we don't overflow. + 2000-10-27 Christopher James Lahey * 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 (); -- cgit v1.2.3