[evolution-data-server] imapx_untagged_fetch: Fix a possible divide-by-zero error.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] imapx_untagged_fetch: Fix a possible divide-by-zero error.
- Date: Wed, 6 Nov 2013 12:51:04 +0000 (UTC)
commit a9d05d991af32e442761a85d7e3676415ab807a4
Author: Matthew Barnes <mbarnes redhat com>
Date: Wed Nov 6 07:51:49 2013 -0500
imapx_untagged_fetch: Fix a possible divide-by-zero error.
camel/providers/imapx/camel-imapx-server.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index 2d38704..cda7bb1 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -2253,7 +2253,6 @@ imapx_untagged_fetch (CamelIMAPXServer *is,
if (!camel_folder_summary_check_uid (folder->summary, mi->uid)) {
RefreshInfoData *data;
- gint cnt;
data = camel_imapx_job_get_data (job);
g_return_val_if_fail (data != NULL, FALSE);
@@ -2264,8 +2263,10 @@ imapx_untagged_fetch (CamelIMAPXServer *is,
camel_folder_change_info_recent_uid (data->changes, mi->uid);
- cnt = (camel_folder_summary_count (folder->summary) * 100 ) /
messages;
- camel_operation_progress (cancellable, cnt ? cnt : 1);
+ if (messages > 0) {
+ gint cnt = (camel_folder_summary_count (folder->summary) *
100) / messages;
+ camel_operation_progress (cancellable, cnt ? cnt : 1);
+ }
} else {
camel_message_info_unref (mi);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]