changeset 20870:c026361d4e63

merge of 'cd26f6af7f8ee75ef909ae08b06ad5a1978051d9' and 'e995c23bc19d0f8a2f833a105da86eaa9218f517'
author Daniel Atallah <daniel.atallah@gmail.com>
date Wed, 10 Oct 2007 01:59:36 +0000
parents a7733677ee20 (diff) 2a6ef74f5a4e (current diff)
children 34fc2a999977
files
diffstat 9 files changed, 23 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/myspace/markup.c	Wed Oct 10 01:06:16 2007 +0000
+++ b/libpurple/protocols/myspace/markup.c	Wed Oct 10 01:59:36 2007 +0000
@@ -400,6 +400,8 @@
 msim_markup_tag_to_html(MsimSession *session, xmlnode *root, gchar **begin, 
 		gchar **end)
 {
+	g_return_if_fail(root != NULL);
+
 	if (g_str_equal(root->name, "f")) {
 		msim_markup_f_to_html(session, root, begin, end);
 	} else if (g_str_equal(root->name, "a")) {
@@ -415,7 +417,7 @@
 	} else {
 		purple_debug_info("msim", "msim_markup_tag_to_html: "
 				"unknown tag name=%s, ignoring", 
-				(root && root->name) ? root->name : "(NULL)");
+				root->name ? root->name : "(NULL)");
 		*begin = g_strdup("");
 		*end = g_strdup("");
 	}
--- a/libpurple/protocols/myspace/message.c	Wed Oct 10 01:06:16 2007 +0000
+++ b/libpurple/protocols/myspace/message.c	Wed Oct 10 01:59:36 2007 +0000
@@ -314,7 +314,7 @@
 	MsimMessageElement *elem;
 	MsimMessage **new;
 	gpointer new_data;
-				
+
 	GString *gs;
 	MsimMessage *dict;
 
@@ -349,7 +349,7 @@
 
 		default:
 			purple_debug_info("msim", "msim_msg_clone_element: unknown type %d\n", elem->type);
-			g_return_if_fail(NULL);
+			g_return_if_reached();
 	}
 
 	/* Append cloned data. Note that the 'name' field is a static string, so it
@@ -905,7 +905,7 @@
 
 		default:
 			g_free(data_string);
-			g_return_if_fail(FALSE);
+			g_return_if_reached();
 			break;
 	}
 
--- a/libpurple/protocols/myspace/myspace.c	Wed Oct 10 01:06:16 2007 +0000
+++ b/libpurple/protocols/myspace/myspace.c	Wed Oct 10 01:59:36 2007 +0000
@@ -2035,18 +2035,14 @@
 msim_do_postprocessing(MsimMessage *msg, const gchar *uid_before, 
 		const gchar *uid_field_name, guint uid)
 {
+	MsimMessageElement *elem;
 	msim_msg_dump("msim_do_postprocessing msg: %s\n", msg);
 
 	/* First, check - if the field already exists, replace <uid> within it */
-	if (msim_msg_get(msg, uid_field_name)) {
-		MsimMessageElement *elem;
+	if ((elem = msim_msg_get(msg, uid_field_name)) != NULL) {
 		gchar *fmt_string;
 		gchar *uid_str, *new_str;
 
-		/* Warning: this is a delicate, but safe, operation */
-
-		elem = msim_msg_get(msg, uid_field_name);
-
 		/* Get the packed element, flattening it. This allows <uid> to be
 		 * replaced within nested data structures, since the replacement is done
 		 * on the linear, packed data, not on a complicated data structure.
--- a/libpurple/protocols/oscar/oscar.c	Wed Oct 10 01:06:16 2007 +0000
+++ b/libpurple/protocols/oscar/oscar.c	Wed Oct 10 01:59:36 2007 +0000
@@ -1128,8 +1128,10 @@
 	aim_clientready(od, conn);
 
 	chatcon = find_oscar_chat_by_conn(gc, conn);
-	chatcon->id = id;
-	chatcon->conv = serv_got_joined_chat(gc, id++, chatcon->show);
+	if (chatcon) {
+		chatcon->id = id;
+		chatcon->conv = serv_got_joined_chat(gc, id++, chatcon->show);
+	}
 }
 
 static void
--- a/libpurple/protocols/qq/buddy_info.c	Wed Oct 10 01:06:16 2007 +0000
+++ b/libpurple/protocols/qq/buddy_info.c	Wed Oct 10 01:59:36 2007 +0000
@@ -366,7 +366,8 @@
 	groups = g_list_remove_link(groups, groups);
 	list = purple_request_field_group_get_fields(groups->data);
 	info->intro = parse_field(&list, FALSE);
-	groups = g_list_remove_link(groups, groups);
+
+	g_list_free(groups);
 
 	qq_send_packet_modify_info(gc, (gchar **) info);
 
--- a/libpurple/protocols/sametime/sametime.c	Wed Oct 10 01:06:16 2007 +0000
+++ b/libpurple/protocols/sametime/sametime.c	Wed Oct 10 01:59:36 2007 +0000
@@ -5563,7 +5563,7 @@
     msgA = _("No matches");
     msgB = _("The identifier '%s' did not match any users in your"
 	     " Sametime community.");
-    msg = g_strdup_printf(msgB, NSTR(res->name));
+    msg = g_strdup_printf(msgB, (res && res->name) ? NSTR(res->name) : "");
 
     purple_notify_error(gc, _("No Matches"), msgA, msg);
 
--- a/libpurple/protocols/yahoo/yahoo_aliases.c	Wed Oct 10 01:06:16 2007 +0000
+++ b/libpurple/protocols/yahoo/yahoo_aliases.c	Wed Oct 10 01:59:36 2007 +0000
@@ -117,7 +117,7 @@
 					if (alias != NULL) {
 						serv_got_alias(cb->gc, yid, alias);
 						purple_debug_info("yahoo","Fetched alias '%s' (%s)\n",alias,id);
-					} else if (g_strcasecmp((alias!=NULL?alias:""),(b->alias!=NULL?b->alias:"")) != 0) {
+					} else if (b->alias != alias && strcmp(b->alias, "") != 0) {
 					/* Or if we have an alias that Yahoo doesn't, send it up */
 						yahoo_update_alias(cb->gc, yid, b->alias);
 						purple_debug_info("yahoo","Sent alias '%s'\n", b->alias);
@@ -216,7 +216,7 @@
 	struct callback_data *cb;
 	PurpleBuddy *buddy;
 	PurpleUtilFetchUrlData *url_data;
-   
+
 	g_return_if_fail(alias!= NULL);
 	g_return_if_fail(who!=NULL);
 	g_return_if_fail(gc!=NULL);
@@ -224,7 +224,7 @@
 	purple_debug_info("yahoo", "Sending '%s' as new alias for user '%s'.\n",alias, who);
 
 	buddy = purple_find_buddy(gc->account, who);
-	if (buddy->proto_data == NULL) {
+	if (buddy == NULL || buddy->proto_data == NULL) {
 		purple_debug_info("yahoo", "Missing proto_data (get_yahoo_aliases must have failed), bailing out\n");
 		return;
 	}
--- a/libpurple/xmlnode.c	Wed Oct 10 01:06:16 2007 +0000
+++ b/libpurple/xmlnode.c	Wed Oct 10 01:59:36 2007 +0000
@@ -131,7 +131,7 @@
 		if(attr_node->type == XMLNODE_TYPE_ATTRIB &&
 				!strcmp(attr_node->name, attr))
 		{
-			if(node->child == attr_node) {
+			if(sibling == NULL) {
 				node->child = attr_node->next;
 			} else {
 				sibling->next = attr_node->next;
@@ -174,7 +174,7 @@
 		   !strcmp(attr_node->name, attr) &&
 		   _xmlnode_compare_xmlns(xmlns, attr_node->xmlns))
 		{
-			if(node->child == attr_node) {
+			if(sibling == NULL) {
 				node->child = attr_node->next;
 			} else {
 				sibling->next = attr_node->next;
--- a/pidgin/gtkaccount.c	Wed Oct 10 01:06:16 2007 +0000
+++ b/pidgin/gtkaccount.c	Wed Oct 10 01:59:36 2007 +0000
@@ -1328,8 +1328,9 @@
 					break;
 
 				case PURPLE_PREF_STRING_LIST:
-					gtk_combo_box_get_active_iter(GTK_COMBO_BOX(widget), &iter);
-					gtk_tree_model_get(gtk_combo_box_get_model(GTK_COMBO_BOX(widget)), &iter, 1, &value2, -1);
+					value2 = NULL;
+					if (gtk_combo_box_get_active_iter(GTK_COMBO_BOX(widget), &iter))
+						gtk_tree_model_get(gtk_combo_box_get_model(GTK_COMBO_BOX(widget)), &iter, 1, &value2, -1);
 					purple_account_set_string(account, setting, value2);
 					break;