/pidgin/main: 23e05a4a90b3: Silence some already dismissed cover...
Tomasz Wasilczyk
twasilczyk at pidgin.im
Tue May 6 17:25:01 EDT 2014
Changeset: 23e05a4a90b3eeb8bfb3bbf36cf51fcfbbf42008
Author: Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date: 2014-05-06 23:24 +0200
Branch: release-2.x.y
URL: https://hg.pidgin.im/pidgin/main/rev/23e05a4a90b3
Description:
Silence some already dismissed coverity warnings
diffstat:
finch/libgnt/gntwidget.c | 2 ++
libpurple/protocols/bonjour/jabber.c | 10 ++++++----
libpurple/protocols/jabber/jabber.c | 2 ++
libpurple/protocols/myspace/zap.c | 5 ++---
pidgin/gtkblist.c | 3 +++
pidgin/gtkthemes.c | 2 +-
6 files changed, 16 insertions(+), 8 deletions(-)
diffs (93 lines):
diff --git a/finch/libgnt/gntwidget.c b/finch/libgnt/gntwidget.c
--- a/finch/libgnt/gntwidget.c
+++ b/finch/libgnt/gntwidget.c
@@ -326,6 +326,8 @@ gnt_widget_destroy(GntWidget *obj)
void
gnt_widget_show(GntWidget *widget)
{
+ g_return_if_fail(widget != NULL);
+
gnt_widget_draw(widget);
gnt_screen_occupy(widget);
}
diff --git a/libpurple/protocols/bonjour/jabber.c b/libpurple/protocols/bonjour/jabber.c
--- a/libpurple/protocols/bonjour/jabber.c
+++ b/libpurple/protocols/bonjour/jabber.c
@@ -373,12 +373,14 @@ void bonjour_jabber_process_packet(Purpl
g_return_if_fail(packet != NULL);
g_return_if_fail(pb != NULL);
- if (!strcmp(packet->name, "message"))
+ if (g_strcmp0(packet->name, "message") == 0)
_jabber_parse_and_write_message_to_ui(packet, pb);
- else if(!strcmp(packet->name, "iq"))
+ else if (g_strcmp0(packet->name, "iq") == 0)
xep_iq_parse(packet, pb);
- else
- purple_debug_warning("bonjour", "Unknown packet: %s\n", packet->name ? packet->name : "(null)");
+ else {
+ purple_debug_warning("bonjour", "Unknown packet: %s\n",
+ packet->name ? packet->name : "(null)");
+ }
}
static void bonjour_jabber_stream_ended(BonjourJabberConversation *bconv) {
diff --git a/libpurple/protocols/jabber/jabber.c b/libpurple/protocols/jabber/jabber.c
--- a/libpurple/protocols/jabber/jabber.c
+++ b/libpurple/protocols/jabber/jabber.c
@@ -471,6 +471,8 @@ void jabber_send_raw(JabberStream *js, c
gc = js->gc;
account = purple_connection_get_account(gc);
+ g_return_if_fail(data != NULL);
+
/* because printing a tab to debug every minute gets old */
if(strcmp(data, "\t")) {
const char *username;
diff --git a/libpurple/protocols/myspace/zap.c b/libpurple/protocols/myspace/zap.c
--- a/libpurple/protocols/myspace/zap.c
+++ b/libpurple/protocols/myspace/zap.c
@@ -201,8 +201,7 @@ msim_blist_node_menu(PurpleBlistNode *no
/* TODO: get rid of once is accessible directly in GUI */
types = msim_attention_types(NULL);
i = 0;
- do
- {
+ for (; types; types = g_list_next(types)) {
PurpleAttentionType *attn;
attn = (PurpleAttentionType *)types->data;
@@ -212,7 +211,7 @@ msim_blist_node_menu(PurpleBlistNode *no
zap_menu = g_list_append(zap_menu, act);
++i;
- } while ((types = g_list_next(types)));
+ }
act = purple_menu_action_new(_("Zap"), NULL, NULL, zap_menu);
menu = g_list_append(NULL, act);
diff --git a/pidgin/gtkblist.c b/pidgin/gtkblist.c
--- a/pidgin/gtkblist.c
+++ b/pidgin/gtkblist.c
@@ -6263,6 +6263,9 @@ static gboolean insert_node(PurpleBuddyL
if(get_iter_from_node(node, &cur))
curptr = &cur;
+ /* XXX: it's not necessary, but let's silence a warning*/
+ memset(&parent_iter, 0, sizeof(parent_iter));
+
if(PURPLE_BLIST_NODE_IS_CONTACT(node) || PURPLE_BLIST_NODE_IS_CHAT(node)) {
current_sort_method->func(node, list, parent_iter, curptr, iter);
} else {
diff --git a/pidgin/gtkthemes.c b/pidgin/gtkthemes.c
--- a/pidgin/gtkthemes.c
+++ b/pidgin/gtkthemes.c
@@ -285,7 +285,7 @@ void pidgin_themes_load_smiley_theme(con
if (*i == '[' && strchr(i, ']') && load) {
struct smiley_list *child = g_new0(struct smiley_list, 1);
child->sml = g_strndup(i+1, strchr(i, ']') - i - 1);
- if (theme->list)
+ if (list)
list->next = child;
else
theme->list = child;
More information about the Commits
mailing list