changeset 23715:62fda5f78f6a

Stu reckoned that having a new block to build the debug string is ugly; I think I agree with him.
author Will Thompson <will.thompson@collabora.co.uk>
date Wed, 13 Aug 2008 15:59:36 +0000
parents b4871d70e916
children 79f5b08a4052
files libpurple/protocols/oscar/oscar.c
diffstat 1 files changed, 16 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/oscar/oscar.c	Wed Aug 13 15:41:48 2008 +0000
+++ b/libpurple/protocols/oscar/oscar.c	Wed Aug 13 15:59:36 2008 +0000
@@ -1635,6 +1635,7 @@
 	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 @@
 				"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 @@
 	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];