# HG changeset patch # User Etan Reisner # Date 1202526553 0 # Node ID c2115e5e613dfc10bd26ac27e0622737acb556dd # Parent 0e68dab2a362d2d6f4efb1bccdaab718a8717026# Parent 510ce2239296d7fe1fa0000f0007aeb576b413c7 merge of '72a2b71dfe259097d115f67e0442fb44934ce686' and 'a411a09d2289df3a95a63d76420099ba40c49395' diff -r 510ce2239296 -r c2115e5e613d libpurple/protocols/myspace/message.c --- a/libpurple/protocols/myspace/message.c Fri Feb 08 15:09:33 2008 +0000 +++ b/libpurple/protocols/myspace/message.c Sat Feb 09 03:09:13 2008 +0000 @@ -50,11 +50,12 @@ { GString *gs; guint i, j; + guint msg_len; gs = g_string_new(""); - + msg_len = strlen(msg); - for (i = 0; i < strlen(msg); ++i) { + for (i = 0; i < msg_len; ++i) { struct MSIM_ESCAPE_REPLACEMENT *replacement; gchar *replace; @@ -93,10 +94,12 @@ { GString *gs; guint i, j; + guint msg_len; gs = g_string_new(""); + msg_len = strlen(msg); - for (i = 0; i < strlen(msg); ++i) { + for (i = 0; i < msg_len; ++i) { struct MSIM_ESCAPE_REPLACEMENT *replacement; gchar replace; @@ -105,7 +108,7 @@ for (j = 0; (replacement = &msim_escape_replacements[j]) && replacement->code != NULL; ++j) { if (msg[i] == replacement->code[0] && - i + 1 < strlen(msg) && + i + 1 < msg_len && msg[i + 1] == replacement->code[1]) { replace = replacement->text; ++i;