empathy r558 - trunk/libempathy



Author: xclaesse
Date: Tue Jan 15 19:33:23 2008
New Revision: 558
URL: http://svn.gnome.org/viewvc/empathy?rev=558&view=rev

Log:
Make use of tp_strdiff() to be NULL-safe. Fixes bug #509656.


Modified:
   trunk/libempathy/empathy-tp-contact-list.c

Modified: trunk/libempathy/empathy-tp-contact-list.c
==============================================================================
--- trunk/libempathy/empathy-tp-contact-list.c	(original)
+++ trunk/libempathy/empathy-tp-contact-list.c	Tue Jan 15 19:33:23 2008
@@ -169,7 +169,7 @@
 	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 @@
 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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]