pidgin/android/libpurple

991cb7ca5eb6
Parents 5ce3fe28942f
Children b6db1930421f
MXit: Append the inline-image reference directly to the message buffer.
It's really not neccessary to use a temporary buffer.
--- a/libpurple/protocols/mxit/formcmds.c Wed Apr 03 11:26:54 2013 +0200
+++ b/libpurple/protocols/mxit/formcmds.c Wed Apr 03 11:32:59 2013 +0200
@@ -325,7 +325,6 @@
const char* img;
const char* reply;
guchar* rawimg;
- char link[256];
gsize rawimglen;
int imgid;
@@ -334,8 +333,7 @@
rawimg = purple_base64_decode(img, &rawimglen);
//purple_util_write_data_to_file_absolute("/tmp/mxitinline.png", (char*) rawimg, rawimglen);
imgid = purple_imgstore_add_with_id(rawimg, rawimglen, NULL);
- g_snprintf(link, sizeof(link), "<img id=\"%i\">", imgid);
- g_string_append_printf(msg, "%s", link);
+ g_string_append_printf(msg, "<img id=\"%i\">", imgid);
mx->flags |= PURPLE_MESSAGE_IMAGES;
}
else {