--- a/libpurple/protocols/mxit/markup.c Thu Jun 14 21:48:21 2012 +0100 +++ b/libpurple/protocols/mxit/markup.c Mon Jul 02 18:54:06 2012 -0700 @@ -361,7 +361,7 @@ int start; unsigned int end; int emo_ofs; - char ii[128]; + char* ii; char tag[64]; int* img_id; @@ -379,8 +379,7 @@ if ( end == mx->msg->len ) /* end of emoticon tag not found */ break; - memset( ii, 0x00, sizeof( ii ) ); - memcpy( ii, &mx->msg->str[emo_ofs], end - emo_ofs ); + ii = g_strndup(&mx->msg->str[emo_ofs], end - emo_ofs); /* remove inline image tag */ g_string_erase( mx->msg, start, ( end - start ) + 1 ); @@ -396,6 +395,8 @@ g_snprintf( tag, sizeof( tag ), "<img id=\"%i\">", *img_id ); g_string_insert( mx->msg, start, tag ); } + + g_free(ii); } }