IMAPX: (utils) use g_return_if_fail() family of functions instead of g_assert()
authorChristian Hilberg <chilberg@src.gnome.org>
Tue, 26 Jun 2012 14:32:53 +0000 (16:32 +0200)
committerMatthew Barnes <mbarnes@redhat.com>
Tue, 26 Jun 2012 15:20:29 +0000 (11:20 -0400)
* changed the function param sanity checking from assertions
  to the g_return*_if_fail() family of functions, so we can
  stumble along instead of barfing in front of the user

camel/camel-imapx-utils.c

index 4a7f2cc..cc3feb8 100644 (file)
@@ -479,7 +479,7 @@ imapx_register_capability (const gchar *capability)
        GList *keys = NULL;
        GList *tmp_keys = NULL;
 
-       g_assert (capability != NULL);
+       g_return_val_if_fail (capability != NULL, 0);
 
        g_mutex_lock (&capa_htable_lock);
 
@@ -504,7 +504,7 @@ imapx_register_capability (const gchar *capability)
 
        /* shift-left biggest-so-far, sanity-check */
        check_id = (capa_id << 1);
-       g_assert (check_id <= (guint64) G_MAXUINT32);
+       g_return_val_if_fail (check_id <= (guint64) G_MAXUINT32, 0);
        capa_id = (guint32) check_id;
 
        /* insert */