# HG changeset patch # User Will Thompson # Date 1218643176 0 # Node ID 62fda5f78f6ab594f1da2f26f4217cd9e283f432 # Parent b4871d70e9165d2c61d0ac117565df804aea067d Stu reckoned that having a new block to build the debug string is ugly; I think I agree with him. diff -r b4871d70e916 -r 62fda5f78f6a libpurple/protocols/oscar/oscar.c --- 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; istr); - g_string_free(msg, TRUE); - } + msg = g_string_new("ssi rights:"); + for (i=0; istr); + g_string_free(msg, TRUE); if (numtypes >= 0) od->rights.maxbuddies = maxitems[0];