[evolution-data-server] Bug 793465 - [NNTP] Fix division by zero when folder is empty



commit db37314f3b04235584663ec4a2634b790974e15e
Author: Fatih Akca <fatihakca5 gmail com>
Date:   Thu Feb 15 17:48:42 2018 +0100

    Bug 793465 - [NNTP] Fix division by zero when folder is empty

 src/camel/providers/nntp/camel-nntp-summary.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/camel/providers/nntp/camel-nntp-summary.c b/src/camel/providers/nntp/camel-nntp-summary.c
index d4e1a50..22dce41 100644
--- a/src/camel/providers/nntp/camel-nntp-summary.c
+++ b/src/camel/providers/nntp/camel-nntp-summary.c
@@ -477,12 +477,13 @@ nntp_get_existing_article_numbers (CamelNNTPSummary *cns,
        while ((ret = camel_nntp_stream_line (nntp_stream, (guchar **) &line, &len, cancellable, error)) > 0) 
{
                guint nn;
 
-               camel_operation_progress (cancellable, (count * 100) / total);
-               count++;
-
                if (len == 1 && g_ascii_strncasecmp (line, ".", len) == 0)
                        break;
 
+               if (total > 0)
+                       camel_operation_progress (cancellable, (count * 100) / total);
+               count++;
+
                nn = strtoul (line, NULL, 10);
                if (nn) {
                        if (!existing_articles)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]