pidgin: fb7114d2: Oscar passing NULL for the debug categor...

resiak at pidgin.im resiak at pidgin.im
Wed Aug 13 11:46:14 EDT 2008


-----------------------------------------------------------------
Revision: fb7114d24ca3125d3f2f99b1f5c97b90dada2e9d
Ancestor: 336f4d55b4825332c968db1af5dd2a142bbbb40c
Author: resiak at pidgin.im
Date: 2008-08-13T15:41:48
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/fb7114d24ca3125d3f2f99b1f5c97b90dada2e9d

Modified files:
        libpurple/protocols/oscar/oscar.c

ChangeLog: 

Oscar passing NULL for the debug category is not great if you're filtering by category.

-------------- next part --------------
============================================================
--- libpurple/protocols/oscar/oscar.c	b341fa8c1043ad50236f445931ae70ba4de010e4
+++ libpurple/protocols/oscar/oscar.c	e0aeef878a2fb02a67c38d90988ca5b7c98e94e3
@@ -1665,11 +1665,14 @@ static void damn_you(gpointer data, gint
 				"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,14 +4935,15 @@ static int purple_ssi_parserights(OscarD
 	maxitems = va_arg(ap, guint16 *);
 	va_end(ap);
 
-	purple_debug_misc("oscar", "ssi rights:");
+	{
+		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);
+	}
 
-	for (i=0; i<numtypes; i++)
-		purple_debug_misc(NULL, " max type 0x%04x=%hd,",
-				   i, maxitems[i]);
-
-	purple_debug_misc(NULL, "\n");
-
 	if (numtypes >= 0)
 		od->rights.maxbuddies = maxitems[0];
 	if (numtypes >= 1)


More information about the Commits mailing list