aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-01-16 03:33:23 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-01-16 03:33:23 +0800
commit9637dc6b0c24f277be3977feafefb3e8cac945f6 (patch)
treed07b0ea259ba157cd9dae98841ee019731e9896b
parentbd20284483d8237f721e069d518e6a979d781b3e (diff)
downloadgsoc2013-empathy-9637dc6b0c24f277be3977feafefb3e8cac945f6.tar
gsoc2013-empathy-9637dc6b0c24f277be3977feafefb3e8cac945f6.tar.gz
gsoc2013-empathy-9637dc6b0c24f277be3977feafefb3e8cac945f6.tar.bz2
gsoc2013-empathy-9637dc6b0c24f277be3977feafefb3e8cac945f6.tar.lz
gsoc2013-empathy-9637dc6b0c24f277be3977feafefb3e8cac945f6.tar.xz
gsoc2013-empathy-9637dc6b0c24f277be3977feafefb3e8cac945f6.tar.zst
gsoc2013-empathy-9637dc6b0c24f277be3977feafefb3e8cac945f6.zip
Make use of tp_strdiff() to be NULL-safe. Fixes bug #509656.
svn path=/trunk/; revision=558
-rw-r--r--libempathy/empathy-tp-contact-list.c20
1 files changed, 7 insertions, 13 deletions
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