[evolution-ews/gnome-3-8] Bug #705658 - Fix errors found by CLANG - Avoid assign an undefined value



commit b16bdfcf7a20f65b6064f54f65c4b135e1c60cd3
Author: Fabiano Fidêncio <fidencio redhat com>
Date:   Thu Aug 8 10:25:31 2013 +0200

    Bug #705658 - Fix errors found by CLANG - Avoid assign an undefined value

 src/server/e-ews-connection.c |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/src/server/e-ews-connection.c b/src/server/e-ews-connection.c
index 4a65931..552e54a 100644
--- a/src/server/e-ews-connection.c
+++ b/src/server/e-ews-connection.c
@@ -961,9 +961,12 @@ ews_handle_resolution_set_param (ESoapParameter *subparam,
 
        subparam = e_soap_parameter_get_first_child_by_name (subparam, "ResolutionSet");
        prop = e_soap_parameter_get_property (subparam, "IncludesLastItemInRange");
-
-       if (prop && !strcmp (prop, "true"))
-               includes_last_item = TRUE;
+       /*
+        * Set the includes_last_item to TRUE as default.
+        * It can avoid an infinite loop in caller, when, for some reason,
+        * we don't receive the last_tag property from the server.
+        */
+       includes_last_item = g_strcmp0 (prop, "false") != 0;
        g_free (prop);
 
        for (subparam = e_soap_parameter_get_first_child_by_name (subparam, "Resolution");
@@ -1043,9 +1046,12 @@ ews_handle_dl_expansion_param (ESoapParameter *subparam,
 
        subparam = e_soap_parameter_get_first_child_by_name (subparam, "DLExpansion");
        prop = e_soap_parameter_get_property (subparam, "IncludesLastItemInRange");
-
-       if (prop && !strcmp (prop, "true"))
-               includes_last_item = TRUE;
+       /*
+        * Set the includes_last_item to TRUE as default.
+        * It can avoid an infinite loop in caller, when, for some reason,
+        * we don't receive the last_tag property from the server.
+        */
+       includes_last_item = g_strcmp0 (prop, "false") != 0;
        g_free (prop);
 
        for (subparam = e_soap_parameter_get_first_child_by_name (subparam, "Mailbox");


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