im.pidgin.pidgin: 16b28ccab43bf55eb778e7c45b7b769e11baecfa

datallah at pidgin.im datallah at pidgin.im
Tue Oct 9 22:09:03 EDT 2007


-----------------------------------------------------------------
Revision: 16b28ccab43bf55eb778e7c45b7b769e11baecfa
Ancestor: 9d35dde0c779cca73548172223ba557f27d61882
Author: datallah at pidgin.im
Date: 2007-10-10T00:08:54
Branch: im.pidgin.pidgin

Modified files:
        libpurple/protocols/myspace/message.c
        libpurple/protocols/myspace/myspace.c

ChangeLog: 

Fix CID 342 (which wasn't wrong, but was inefficient and confusing.)

-------------- next part --------------
============================================================
--- libpurple/protocols/myspace/message.c	19818f7c026c6e17696b19ad8af7087633baa252
+++ libpurple/protocols/myspace/message.c	ba8b2b07ae68f22d15e6f95f3ebb95cade25ddaa
@@ -314,7 +314,7 @@ msim_msg_clone_element(gpointer data, gp
 	MsimMessageElement *elem;
 	MsimMessage **new;
 	gpointer new_data;
-				
+
 	GString *gs;
 	MsimMessage *dict;
 
@@ -349,7 +349,7 @@ msim_msg_clone_element(gpointer data, gp
 
 		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 @@ msim_msg_pack_element(gpointer data, gpo
 
 		default:
 			g_free(data_string);
-			g_return_if_fail(FALSE);
+			g_return_if_reached();
 			break;
 	}
 
============================================================
--- libpurple/protocols/myspace/myspace.c	bb0bbb8393fb60ee046f8046dd9f5e27beec957b
+++ libpurple/protocols/myspace/myspace.c	d8502c3ea4015fc5905ec5f1128cfa764454406c
@@ -2035,18 +2035,14 @@ msim_do_postprocessing(MsimMessage *msg,
 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.


More information about the Commits mailing list