changeset 23714:b4871d70e916

Oscar passing NULL for the debug category is not great if you're filtering by category.
author Will Thompson <will.thompson@collabora.co.uk>
date Wed, 13 Aug 2008 15:41:48 +0000
parents 92d0151e907b
children 62fda5f78f6a
files libpurple/protocols/oscar/oscar.c
diffstat 1 files changed, 16 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/oscar/oscar.c	Wed Aug 13 15:25:51 2008 +0000
+++ b/libpurple/protocols/oscar/oscar.c	Wed Aug 13 15:41:48 2008 +0000
@@ -1665,11 +1665,14 @@
 				"from " AIMHASHDATA "--that's bad.\n");
 	}
 	m[16] = '\0';
-	purple_debug_misc("oscar", "Sending hash: ");
-	for (x = 0; x < 16; x++)
-		purple_debug_misc(NULL, "%02hhx ", (unsigned char)m[x]);
-
-	purple_debug_misc(NULL, "\n");
+	{
+		GString *msg = g_string_new("Sending hash: ");
+		for (x = 0; x < 16; x++)
+			g_string_append_printf(msg, "%02hhx ", (unsigned char)m[x]);
+		g_string_append(msg, "\n");
+		purple_debug_misc("oscar", msg->str);
+		g_string_free(msg, TRUE);
+	}
 	purple_input_remove(pos->inpa);
 	close(pos->fd);
 	aim_sendmemblock(od, pos->conn, 0, 16, m, AIM_SENDMEMBLOCK_FLAG_ISHASH);
@@ -4932,13 +4935,14 @@
 	maxitems = va_arg(ap, guint16 *);
 	va_end(ap);
 
-	purple_debug_misc("oscar", "ssi rights:");
-
-	for (i=0; i<numtypes; i++)
-		purple_debug_misc(NULL, " max type 0x%04x=%hd,",
-				   i, maxitems[i]);
-
-	purple_debug_misc(NULL, "\n");
+	{
+		GString *msg = g_string_new("ssi rights:");
+		for (i=0; i<numtypes; i++)
+			g_string_append_printf(msg, " max type 0x%04x=%hd,", i, maxitems[i]);
+		g_string_append(msg, "\n");
+		purple_debug_misc("oscar", msg->str);
+		g_string_free(msg, TRUE);
+	}
 
 	if (numtypes >= 0)
 		od->rights.maxbuddies = maxitems[0];