diff libpurple/protocols/myspace/myspace.c @ 20861:9c2ec10933b2

Fix CID 342 (which wasn't wrong, but was inefficient and confusing.)
author Daniel Atallah <daniel.atallah@gmail.com>
date Wed, 10 Oct 2007 00:08:54 +0000
parents 61045691aa72
children bbcc9e206c43 aee8d876fed1
line wrap: on
line diff
--- a/libpurple/protocols/myspace/myspace.c	Wed Oct 10 00:00:21 2007 +0000
+++ b/libpurple/protocols/myspace/myspace.c	Wed Oct 10 00:08:54 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.