changeset 24670:5ec72dbdd28e

Fix warnings where size_t/gsize was used for printf with the wrong format specifier and fix some free's that should be g_free. Fixes #7782. committer: Elliott Sales de Andrade <qulogic@pidgin.im>
author Paul Aurich <paul@darkrain42.org>
date Sun, 14 Dec 2008 02:58:44 +0000
parents 5b703111614e
children d6de4f9de12d
files libpurple/protocols/oscar/family_auth.c libpurple/protocols/qq/group_im.c libpurple/protocols/qq/im.c libpurple/protocols/yahoo/yahoo_picture.c pidgin/gtkutils.c
diffstat 5 files changed, 29 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/oscar/family_auth.c	Sat Dec 13 02:41:46 2008 +0000
+++ b/libpurple/protocols/oscar/family_auth.c	Sun Dec 14 02:58:44 2008 +0000
@@ -597,18 +597,18 @@
 {
 	if (od->authinfo != NULL)
 	{
-		free(od->authinfo->sn);
-		free(od->authinfo->bosip);
-		free(od->authinfo->errorurl);
-		free(od->authinfo->email);
-		free(od->authinfo->chpassurl);
-		free(od->authinfo->latestrelease.name);
-		free(od->authinfo->latestrelease.url);
-		free(od->authinfo->latestrelease.info);
-		free(od->authinfo->latestbeta.name);
-		free(od->authinfo->latestbeta.url);
-		free(od->authinfo->latestbeta.info);
-		free(od->authinfo);
+		g_free(od->authinfo->sn);
+		g_free(od->authinfo->bosip);
+		g_free(od->authinfo->errorurl);
+		g_free(od->authinfo->email);
+		g_free(od->authinfo->chpassurl);
+		g_free(od->authinfo->latestrelease.name);
+		g_free(od->authinfo->latestrelease.url);
+		g_free(od->authinfo->latestrelease.info);
+		g_free(od->authinfo->latestbeta.name);
+		g_free(od->authinfo->latestbeta.url);
+		g_free(od->authinfo->latestbeta.info);
+		g_free(od->authinfo);
 	}
 }
 
--- a/libpurple/protocols/qq/group_im.c	Sat Dec 13 02:41:46 2008 +0000
+++ b/libpurple/protocols/qq/group_im.c	Sun Dec 14 02:58:44 2008 +0000
@@ -378,7 +378,7 @@
 	g_return_val_if_fail(id != 0 && what != NULL, -1);
 
 	qd = (qq_data *) gc->proto_data;
-	purple_debug_info("QQ", "Send chat IM to %u, len %d:\n%s\n", id, strlen(what), what);
+	purple_debug_info("QQ", "Send chat IM to %u, len %" G_GSIZE_FORMAT ":\n%s\n", id, strlen(what), what);
 
 	/* qq_show_packet("chat IM UTF8", (guint8 *)what, strlen(what)); */
 
--- a/libpurple/protocols/qq/im.c	Sat Dec 13 02:41:46 2008 +0000
+++ b/libpurple/protocols/qq/im.c	Sun Dec 14 02:58:44 2008 +0000
@@ -1258,7 +1258,7 @@
 	g_return_val_if_fail(who != NULL && what != NULL, -1);
 
 	qd = (qq_data *) gc->proto_data;
-	purple_debug_info("QQ", "Send IM to %s, len %d:\n%s\n", who, strlen(what), what);
+	purple_debug_info("QQ", "Send IM to %s, len %" G_GSIZE_FORMAT ":\n%s\n", who, strlen(what), what);
 
 	uid_to = purple_name_to_uid(who);
 	if (uid_to == qd->uid) {
--- a/libpurple/protocols/yahoo/yahoo_picture.c	Sat Dec 13 02:41:46 2008 +0000
+++ b/libpurple/protocols/yahoo/yahoo_picture.c	Sun Dec 14 02:58:44 2008 +0000
@@ -408,8 +408,10 @@
 	if (ret < 0 && errno == EAGAIN)
 		return;
 	else if (ret <= 0) {
-		purple_debug_info("yahoo", "Buddy icon upload response (%d) bytes (> ~400 indicates failure):\n%.*s\n",
-			d->str->len, d->str->len, d->str->str);
+		/* There are other problems if d->str->len overflows, so shut up the
+		 * warning on 64-bit. */
+		purple_debug_info("yahoo", "Buddy icon upload response (%" G_GSIZE_FORMAT ") bytes (> ~400 indicates failure):\n%.*s\n",
+			d->str->len, (guint)d->str->len, d->str->str);
 
 		yahoo_buddy_icon_upload_data_free(d);
 		return;
@@ -517,7 +519,8 @@
 	g_string_prepend(d->str, header);
 	g_free(header);
 
-	purple_debug_info("yahoo", "Buddy icon upload data:\n%.*s\n", d->str->len, d->str->str);
+	/* There are other problems if we're uploading over 4GB of data */
+	purple_debug_info("yahoo", "Buddy icon upload data:\n%.*s\n", (guint)d->str->len, d->str->str);
 
 	d->fd = source;
 	d->watcher = purple_input_add(d->fd, PURPLE_INPUT_WRITE, yahoo_buddy_icon_upload_pending, d);
--- a/pidgin/gtkutils.c	Sat Dec 13 02:41:46 2008 +0000
+++ b/pidgin/gtkutils.c	Sun Dec 14 02:58:44 2008 +0000
@@ -1502,16 +1502,16 @@
 
 		break;
 	}
-	free(data->filename);
-	free(data->who);
-	free(data);
+	g_free(data->filename);
+	g_free(data->who);
+	g_free(data);
 }
 
 static void dnd_image_cancel_callback(_DndData *data, int choice)
 {
-	free(data->filename);
-	free(data->who);
-	free(data);
+	g_free(data->filename);
+	g_free(data->who);
+	g_free(data);
 }
 
 static void dnd_set_icon_ok_cb(_DndData *data)
@@ -1521,9 +1521,9 @@
 
 static void dnd_set_icon_cancel_cb(_DndData *data)
 {
-	free(data->filename);
-	free(data->who);
-	free(data);
+	g_free(data->filename);
+	g_free(data->who);
+	g_free(data);
 }
 
 void