diff options
author | Daniel Atallah <datallah@pidgin.im> | 2007-10-10 01:59:36 +0000 |
---|---|---|
committer | Daniel Atallah <datallah@pidgin.im> | 2007-10-10 01:59:36 +0000 |
commit | 109c42bb741d63deaa9ef3163c7c1830ccdcdb23 (patch) | |
tree | b7bbb3c7efb4106fd74d761e3f975e7b9afba289 | |
parent | ebd3c4b692cd9456ece8e1980209b9ce6919cdec (diff) | |
parent | 41e65b5fa0268fd630e82e3a12431828b496c1f7 (diff) | |
download | pidgin-109c42bb741d63deaa9ef3163c7c1830ccdcdb23.tar.gz |
merge of '161ecea60f5041fd96f19cea8f2ad3f98588ed44'
and '35ddb62c6451da865eed5078b7d22569e5754afa'
-rw-r--r-- | libpurple/protocols/myspace/markup.c | 4 | ||||
-rw-r--r-- | libpurple/protocols/myspace/message.c | 6 | ||||
-rw-r--r-- | libpurple/protocols/myspace/myspace.c | 8 | ||||
-rw-r--r-- | libpurple/protocols/oscar/oscar.c | 6 | ||||
-rw-r--r-- | libpurple/protocols/qq/buddy_info.c | 3 | ||||
-rw-r--r-- | libpurple/protocols/sametime/sametime.c | 2 | ||||
-rw-r--r-- | libpurple/protocols/yahoo/yahoo_aliases.c | 6 | ||||
-rw-r--r-- | libpurple/xmlnode.c | 4 | ||||
-rw-r--r-- | pidgin/gtkaccount.c | 5 |
9 files changed, 23 insertions, 21 deletions
diff --git a/libpurple/protocols/myspace/markup.c b/libpurple/protocols/myspace/markup.c index 6a08253505..24aa8c4a94 100644 --- a/libpurple/protocols/myspace/markup.c +++ b/libpurple/protocols/myspace/markup.c @@ -400,6 +400,8 @@ static void msim_markup_tag_to_html(MsimSession *session, xmlnode *root, gchar **begin, gchar **end) { + g_return_if_fail(root != NULL); + if (g_str_equal(root->name, "f")) { msim_markup_f_to_html(session, root, begin, end); } else if (g_str_equal(root->name, "a")) { @@ -415,7 +417,7 @@ msim_markup_tag_to_html(MsimSession *session, xmlnode *root, gchar **begin, } else { purple_debug_info("msim", "msim_markup_tag_to_html: " "unknown tag name=%s, ignoring", - (root && root->name) ? root->name : "(NULL)"); + root->name ? root->name : "(NULL)"); *begin = g_strdup(""); *end = g_strdup(""); } 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. diff --git a/libpurple/protocols/oscar/oscar.c b/libpurple/protocols/oscar/oscar.c index 6dc5b7e758..eaa10d3d1f 100644 --- a/libpurple/protocols/oscar/oscar.c +++ b/libpurple/protocols/oscar/oscar.c @@ -1128,8 +1128,10 @@ flap_connection_established_chat(OscarData *od, FlapConnection *conn) 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 diff --git a/libpurple/protocols/qq/buddy_info.c b/libpurple/protocols/qq/buddy_info.c index 4b5f3c2f14..aaef671dc1 100644 --- a/libpurple/protocols/qq/buddy_info.c +++ b/libpurple/protocols/qq/buddy_info.c @@ -366,7 +366,8 @@ static void modify_info_ok_cb(modify_info_data *mid, PurpleRequestFields *fields 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); diff --git a/libpurple/protocols/sametime/sametime.c b/libpurple/protocols/sametime/sametime.c index 52587aa2ca..b575bdbcaa 100644 --- a/libpurple/protocols/sametime/sametime.c +++ b/libpurple/protocols/sametime/sametime.c @@ -5563,7 +5563,7 @@ static void search_resolved(struct mwServiceResolve *srvc, 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); diff --git a/libpurple/protocols/yahoo/yahoo_aliases.c b/libpurple/protocols/yahoo/yahoo_aliases.c index 0b2380655e..2403287e88 100644 --- a/libpurple/protocols/yahoo/yahoo_aliases.c +++ b/libpurple/protocols/yahoo/yahoo_aliases.c @@ -117,7 +117,7 @@ yahoo_fetch_aliases_cb(PurpleUtilFetchUrlData *url_data, gpointer user_data,cons 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 @@ yahoo_update_alias(PurpleConnection *gc, const char *who, const char *alias) 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 @@ yahoo_update_alias(PurpleConnection *gc, const char *who, const char *alias) 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;
}
diff --git a/libpurple/xmlnode.c b/libpurple/xmlnode.c index 56890f5e56..e2f72694cf 100644 --- a/libpurple/xmlnode.c +++ b/libpurple/xmlnode.c @@ -131,7 +131,7 @@ xmlnode_remove_attrib(xmlnode *node, const char *attr) 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 @@ xmlnode_remove_attrib_with_namespace(xmlnode *node, const char *attr, const char !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; diff --git a/pidgin/gtkaccount.c b/pidgin/gtkaccount.c index c406981e3d..21e14c80a7 100644 --- a/pidgin/gtkaccount.c +++ b/pidgin/gtkaccount.c @@ -1328,8 +1328,9 @@ ok_account_prefs_cb(GtkWidget *w, AccountPrefsDialog *dialog) 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; |