diff options
-rw-r--r-- | otr.c | 2 | ||||
-rw-r--r-- | protocols/oscar/rxhandlers.c | 10 | ||||
-rw-r--r-- | protocols/purple/purple.c | 4 |
3 files changed, 5 insertions, 11 deletions
@@ -1513,7 +1513,7 @@ struct im_connection *check_imc(void *opdata, const char *accountname, break; } } - assert(l != NULL); /* a match should always be found */ + g_return_val_if_fail(l, NULL); if (!l) { return NULL; } diff --git a/protocols/oscar/rxhandlers.c b/protocols/oscar/rxhandlers.c index 6ff106b2..0f1bb3d7 100644 --- a/protocols/oscar/rxhandlers.c +++ b/protocols/oscar/rxhandlers.c @@ -234,14 +234,8 @@ int aim_conn_addhandler(aim_session_t *sess, aim_conn_t *conn, guint16 family, g { struct aim_rxcblist_s *newcb; - if (!conn) { - return -1; - } - - if (checkdisallowed(family, type)) { - g_assert(0); - return -1; - } + g_return_val_if_fail(conn, -1); + g_return_val_if_fail(checkdisallowed(family, type), -1); if (!(newcb = (struct aim_rxcblist_s *) g_new0(struct aim_rxcblist_s, 1))) { return -1; diff --git a/protocols/purple/purple.c b/protocols/purple/purple.c index 9e0dc57e..4c560818 100644 --- a/protocols/purple/purple.c +++ b/protocols/purple/purple.c @@ -1689,8 +1689,8 @@ void purple_initmodule() return; } - g_assert((int) B_EV_IO_READ == (int) PURPLE_INPUT_READ); - g_assert((int) B_EV_IO_WRITE == (int) PURPLE_INPUT_WRITE); + g_return_if_fail((int) B_EV_IO_READ == (int) PURPLE_INPUT_READ); + g_return_if_fail((int) B_EV_IO_WRITE == (int) PURPLE_INPUT_WRITE); dir = g_strdup_printf("%s/purple", global.conf->configdir); purple_util_set_user_dir(dir); |