From 9637dc6b0c24f277be3977feafefb3e8cac945f6 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Tue, 15 Jan 2008 19:33:23 +0000 Subject: Make use of tp_strdiff() to be NULL-safe. Fixes bug #509656. svn path=/trunk/; revision=558 --- libempathy/empathy-tp-contact-list.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'libempathy') diff --git a/libempathy/empathy-tp-contact-list.c b/libempathy/empathy-tp-contact-list.c index 2f366ff10..fbdd50b7c 100644 --- a/libempathy/empathy-tp-contact-list.c +++ b/libempathy/empathy-tp-contact-list.c @@ -169,7 +169,7 @@ tp_contact_list_find_group (EmpathyTpContactList *list, GList *l; for (l = priv->groups; l; l = l->next) { - if (strcmp (group, empathy_tp_group_get_name (l->data)) == 0) { + if (!tp_strdiff (group, empathy_tp_group_get_name (l->data))) { return l->data; } } @@ -180,22 +180,16 @@ static TpContactListType tp_contact_list_get_type (EmpathyTpContactList *list, EmpathyTpGroup *group) { - EmpathyTpContactListPriv *priv; - TpContactListType list_type; - const gchar *name; - - priv = GET_PRIV (list); + const gchar *name; name = empathy_tp_group_get_name (group); - if (strcmp (name, "subscribe") == 0) { - list_type = TP_CONTACT_LIST_TYPE_SUBSCRIBE; - } else if (strcmp (name, "publish") == 0) { - list_type = TP_CONTACT_LIST_TYPE_PUBLISH; - } else { - list_type = TP_CONTACT_LIST_TYPE_UNKNOWN; + if (!tp_strdiff (name, "subscribe")) { + return TP_CONTACT_LIST_TYPE_SUBSCRIBE; + } else if (!tp_strdiff (name, "publish")) { + return TP_CONTACT_LIST_TYPE_PUBLISH; } - return list_type; + return TP_CONTACT_LIST_TYPE_UNKNOWN; } static void -- cgit v1.2.3