pidgin: 9a82f681: Fix warnings where size_t/gsize was used..

qulogic at pidgin.im qulogic at pidgin.im
Sat Dec 13 22:19:01 EST 2008


-----------------------------------------------------------------
Revision: 9a82f68178e1f6dc5aec00804a670d171ffca463
Ancestor: 3dd9c7e41e98570d3626051c1fa70d698554a58a
Author: paul at aurich.com
Date: 2008-12-14T02:58:44
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/9a82f68178e1f6dc5aec00804a670d171ffca463

Modified 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

ChangeLog: 

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.

-------------- next part --------------
============================================================
--- libpurple/protocols/oscar/family_auth.c	b8dc8289b1075f6d7851f730a0d7365801152d0b
+++ libpurple/protocols/oscar/family_auth.c	f254a2f8193a50d966cd94a8d21c75b5be30153d
@@ -597,18 +597,18 @@ auth_shutdown(OscarData *od, aim_module_
 {
 	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);
 	}
 }
 
============================================================
--- libpurple/protocols/qq/group_im.c	d8483aa179793e7ac2697e910f2af0a2f746fc23
+++ libpurple/protocols/qq/group_im.c	263c53a2f53ec6f4ac06f25b5f050dc37f16450b
@@ -378,7 +378,7 @@ int qq_chat_send(PurpleConnection *gc, i
 	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)); */
 
============================================================
--- libpurple/protocols/qq/im.c	fa7dd09b964c98e09a01309b92560fc5a130d147
+++ libpurple/protocols/qq/im.c	013035d827433e67384c935dd3ed0ef769a563f6
@@ -1258,7 +1258,7 @@ gint qq_send_im(PurpleConnection *gc, co
 	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) {
============================================================
--- libpurple/protocols/yahoo/yahoo_picture.c	05ac3cf5fad5e74b9ad6594d9894bfbc0db0d839
+++ libpurple/protocols/yahoo/yahoo_picture.c	0755d6f680f82bc049cc9d2fa6ad513304c497a6
@@ -408,8 +408,10 @@ static void yahoo_buddy_icon_upload_read
 	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 @@ static void yahoo_buddy_icon_upload_conn
 	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);
============================================================
--- pidgin/gtkutils.c	5d3e217fe4eb4b27259aaceafb882cf2a2adcb29
+++ pidgin/gtkutils.c	1a54ad7fad32dd45944c402c20a52b964e2fd9bf
@@ -1502,16 +1502,16 @@ static void dnd_image_ok_callback(_DndDa
 
 		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(_DndD
 
 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


More information about the Commits mailing list