pidgin: e6ee9a41: Stu reckoned that having a new block to ...

resiak at pidgin.im resiak at pidgin.im
Wed Aug 13 12:05:50 EDT 2008


-----------------------------------------------------------------
Revision: e6ee9a41699ace52c9c9cf6d1315857bb9fc327a
Ancestor: fb7114d24ca3125d3f2f99b1f5c97b90dada2e9d
Author: resiak at pidgin.im
Date: 2008-08-13T15:59:36
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/e6ee9a41699ace52c9c9cf6d1315857bb9fc327a

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

ChangeLog: 

Stu reckoned that having a new block to build the debug string is ugly;
I think I agree with him.

-------------- next part --------------
============================================================
--- libpurple/protocols/oscar/oscar.c	e0aeef878a2fb02a67c38d90988ca5b7c98e94e3
+++ libpurple/protocols/oscar/oscar.c	92d36d936047bbf6fa7f0000f408a72ec728ea20
@@ -1635,6 +1635,7 @@ static void damn_you(gpointer data, gint
 	char in = '\0';
 	int x = 0;
 	unsigned char m[17];
+	GString *msg;
 
 	while (read(pos->fd, &in, 1) == 1) {
 		if (in == '\n')
@@ -1665,14 +1666,14 @@ static void damn_you(gpointer data, gint
 				"from " AIMHASHDATA "--that's bad.\n");
 	}
 	m[16] = '\0';
-	{
-		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);
-	}
+
+	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);
@@ -4929,20 +4930,19 @@ static int purple_ssi_parserights(OscarD
 	va_list ap;
 	int numtypes;
 	guint16 *maxitems;
+	GString *msg;
 
 	va_start(ap, fr);
 	numtypes = va_arg(ap, int);
 	maxitems = va_arg(ap, guint16 *);
 	va_end(ap);
 
-	{
-		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);
-	}
+	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];


More information about the Commits mailing list