]> git.0d.be Git - empathy.git/commitdiff
Make use of tp_strdiff() to be NULL-safe. Fixes bug #509656.
authorXavier Claessens <xclaesse@src.gnome.org>
Tue, 15 Jan 2008 19:33:23 +0000 (19:33 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Tue, 15 Jan 2008 19:33:23 +0000 (19:33 +0000)
svn path=/trunk/; revision=558

libempathy/empathy-tp-contact-list.c

index 2f366ff103dee9fb4a159afeab0bcd596901b833..fbdd50b7cb187c379c2e4705c97c8cbdfe89392a 100644 (file)
@@ -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