summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Atallah <datallah@pidgin.im>2007-10-10 00:08:54 +0000
committerDaniel Atallah <datallah@pidgin.im>2007-10-10 00:08:54 +0000
commitd12d0b52935988f77f1cfa74381adc78474f7dc1 (patch)
tree56cdcf27847dca79859e3ab8d6dc58b9e0dd83bb
parent220f7086b2c3cbddaf7278d597e312d1a9751c9f (diff)
downloadpidgin-d12d0b52935988f77f1cfa74381adc78474f7dc1.tar.gz
Fix CID 342 (which wasn't wrong, but was inefficient and confusing.)
-rw-r--r--libpurple/protocols/myspace/message.c6
-rw-r--r--libpurple/protocols/myspace/myspace.c8
2 files changed, 5 insertions, 9 deletions
diff --git a/libpurple/protocols/myspace/message.c b/libpurple/protocols/myspace/message.c
index 7524d4e17e..99244b63a0 100644
--- a/libpurple/protocols/myspace/message.c
+++ b/libpurple/protocols/myspace/message.c
@@ -314,7 +314,7 @@ msim_msg_clone_element(gpointer data, gpointer user_data)
MsimMessageElement *elem;
MsimMessage **new;
gpointer new_data;
-
+
GString *gs;
MsimMessage *dict;
@@ -349,7 +349,7 @@ msim_msg_clone_element(gpointer data, gpointer user_data)
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, gpointer user_data)
default:
g_free(data_string);
- g_return_if_fail(FALSE);
+ g_return_if_reached();
break;
}
diff --git a/libpurple/protocols/myspace/myspace.c b/libpurple/protocols/myspace/myspace.c
index a904c87091..d9d63a9533 100644
--- a/libpurple/protocols/myspace/myspace.c
+++ b/libpurple/protocols/myspace/myspace.c
@@ -2035,18 +2035,14 @@ static MsimMessage *
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.