# HG changeset patch # User Daniel Atallah # Date 1191974934 0 # Node ID 9c2ec10933b252c2fe99df5da12ed348af9c6f6e # Parent 2447efa8c93b6ac5306c138b0331eff2f9d85577 Fix CID 342 (which wasn't wrong, but was inefficient and confusing.) diff -r 2447efa8c93b -r 9c2ec10933b2 libpurple/protocols/myspace/message.c --- a/libpurple/protocols/myspace/message.c Wed Oct 10 00:00:21 2007 +0000 +++ b/libpurple/protocols/myspace/message.c Wed Oct 10 00:08:54 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; } diff -r 2447efa8c93b -r 9c2ec10933b2 libpurple/protocols/myspace/myspace.c --- 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 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 to be * replaced within nested data structures, since the replacement is done * on the linear, packed data, not on a complicated data structure.