changeset 20336:b93e7be3847b

applied changes from 9d35dde0c779cca73548172223ba557f27d61882 through cd26f6af7f8ee75ef909ae08b06ad5a1978051d9
author Luke Schierer <lschiere@pidgin.im>
date Sat, 20 Oct 2007 15:57:22 +0000
parents 5defb0546059
children 91f1465b34e9
files libpurple/protocols/myspace/message.c libpurple/protocols/myspace/myspace.c libpurple/protocols/oscar/oscar.c libpurple/protocols/qq/buddy_info.c libpurple/protocols/sametime/sametime.c libpurple/protocols/yahoo/yahoo_aliases.c libpurple/xmlnode.c pidgin/gtkaccount.c
diffstat 8 files changed, 20 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/myspace/message.c	Fri Oct 19 18:36:08 2007 +0000
+++ b/libpurple/protocols/myspace/message.c	Sat Oct 20 15:57:22 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	Fri Oct 19 18:36:08 2007 +0000
+++ b/libpurple/protocols/myspace/myspace.c	Sat Oct 20 15:57:22 2007 +0000
@@ -2030,18 +2030,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	Fri Oct 19 18:36:08 2007 +0000
+++ b/libpurple/protocols/oscar/oscar.c	Sat Oct 20 15:57:22 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	Fri Oct 19 18:36:08 2007 +0000
+++ b/libpurple/protocols/qq/buddy_info.c	Sat Oct 20 15:57:22 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	Fri Oct 19 18:36:08 2007 +0000
+++ b/libpurple/protocols/sametime/sametime.c	Sat Oct 20 15:57:22 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	Fri Oct 19 18:36:08 2007 +0000
+++ b/libpurple/protocols/yahoo/yahoo_aliases.c	Sat Oct 20 15:57:22 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	Fri Oct 19 18:36:08 2007 +0000
+++ b/libpurple/xmlnode.c	Sat Oct 20 15:57:22 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	Fri Oct 19 18:36:08 2007 +0000
+++ b/pidgin/gtkaccount.c	Sat Oct 20 15:57:22 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;