/pidgin/main: 6625cbf09e08: Fix various other minor issues ident...

Daniel Atallah datallah at pidgin.im
Tue Feb 19 00:32:38 EST 2013


Changeset: 6625cbf09e0836b9d8db4c19666f47f48daf6432
Author:	 Daniel Atallah <datallah at pidgin.im>
Date:	 2013-02-19 00:32 -0500
Branch:	 release-2.x.y
URL: http://hg.pidgin.im/pidgin/main/rev/6625cbf09e08

Description:

Fix various other minor issues identified in the coverity scan.

diffstat:

 libpurple/protocols/jabber/bosh.c       |  6 ++----
 libpurple/protocols/oscar/family_icbm.c |  2 +-
 libpurple/theme-loader.c                |  1 +
 libpurple/upnp.c                        |  2 --
 pidgin/gtkimhtml.c                      |  7 ++++---
 5 files changed, 8 insertions(+), 10 deletions(-)

diffs (76 lines):

diff --git a/libpurple/protocols/jabber/bosh.c b/libpurple/protocols/jabber/bosh.c
--- a/libpurple/protocols/jabber/bosh.c
+++ b/libpurple/protocols/jabber/bosh.c
@@ -348,10 +348,8 @@ jabber_bosh_connection_send(PurpleBOSHCo
 		 * sent immediately), queue up the data and start a timer to flush
 		 * the buffer.
 		 */
-		if (data) {
-			int len = data ? strlen(data) : 0;
-			purple_circ_buffer_append(conn->pending, data, len);
-		}
+		if (data)
+			purple_circ_buffer_append(conn->pending, data, strlen(data));
 
 		if (purple_debug_is_verbose())
 			purple_debug_misc("jabber", "bosh: %p has %" G_GSIZE_FORMAT " bytes in "
diff --git a/libpurple/protocols/oscar/family_icbm.c b/libpurple/protocols/oscar/family_icbm.c
--- a/libpurple/protocols/oscar/family_icbm.c
+++ b/libpurple/protocols/oscar/family_icbm.c
@@ -156,7 +156,7 @@ error(OscarData *od, FlapConnection *con
 
 	purple_debug_error("oscar",
 			   "Message error with bn %s and reason %hu and errcode %hu\n",
-				(bn != NULL ? bn : ""), reason, errcode);
+				bn, reason, errcode);
 
 #ifdef TODOFT
 	/* If this was a file transfer request, bn is a cookie */
diff --git a/libpurple/theme-loader.c b/libpurple/theme-loader.c
--- a/libpurple/theme-loader.c
+++ b/libpurple/theme-loader.c
@@ -63,6 +63,7 @@ purple_theme_loader_get_property(GObject
 	switch (param_id) {
 		case PROP_TYPE:
 			g_value_set_string(value, purple_theme_loader_get_type_string(theme_loader));
+			break;
 		default:
 			G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, psec);
 			break;
diff --git a/libpurple/upnp.c b/libpurple/upnp.c
--- a/libpurple/upnp.c
+++ b/libpurple/upnp.c
@@ -746,7 +746,6 @@ const gchar *
 purple_upnp_get_public_ip()
 {
 	if (control_info.status == PURPLE_UPNP_STATUS_DISCOVERED
-			&& control_info.publicip
 			&& strlen(control_info.publicip) > 0)
 		return control_info.publicip;
 
@@ -805,7 +804,6 @@ static const gchar *
 purple_upnp_get_internal_ip(void)
 {
 	if (control_info.status == PURPLE_UPNP_STATUS_DISCOVERED
-			&& control_info.internalip
 			&& strlen(control_info.internalip) > 0)
 		return control_info.internalip;
 
diff --git a/pidgin/gtkimhtml.c b/pidgin/gtkimhtml.c
--- a/pidgin/gtkimhtml.c
+++ b/pidgin/gtkimhtml.c
@@ -2353,10 +2353,11 @@ gtk_imhtml_is_tag (const gchar *string,
 	if (!g_ascii_strncasecmp(string, "!--", strlen ("!--"))) {
 		gchar *e = strstr (string + strlen("!--"), "-->");
 		if (e) {
-			if (len)
+			if (len) {
 				*len = e - string + strlen ("-->");
-			if (tag)
-				*tag = g_strndup (string + strlen ("!--"), *len - strlen ("!---->"));
+				if (tag)
+					*tag = g_strndup (string + strlen ("!--"), *len - strlen ("!---->"));
+			}
 			return TRUE;
 		}
 	}



More information about the Commits mailing list