diff options
author | Jacob "Ulysses" Berkman <jacob@helixcode.com> | 2000-10-28 03:14:14 +0800 |
---|---|---|
committer | Jacob Berkman <jberkman@src.gnome.org> | 2000-10-28 03:14:14 +0800 |
commit | 81a3b9a47a5429c12947d6dde429ad6f6648337c (patch) | |
tree | c06457731e15e5d8f90152944c3776609801cdf4 | |
parent | 4edb2c4651a6efb370cadb79a2bd7624d7a2a09c (diff) | |
download | gsoc2013-evolution-81a3b9a47a5429c12947d6dde429ad6f6648337c.tar gsoc2013-evolution-81a3b9a47a5429c12947d6dde429ad6f6648337c.tar.gz gsoc2013-evolution-81a3b9a47a5429c12947d6dde429ad6f6648337c.tar.bz2 gsoc2013-evolution-81a3b9a47a5429c12947d6dde429ad6f6648337c.tar.lz gsoc2013-evolution-81a3b9a47a5429c12947d6dde429ad6f6648337c.tar.xz 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
-rw-r--r-- | filter/ChangeLog | 5 | ||||
-rw-r--r-- | 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 <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 (); |