Mercurial > pidgin
changeset 7592:582f764b26f6
[gaim-migrate @ 8210]
This should better parse bodies in binary strings.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Sat, 22 Nov 2003 01:13:00 +0000 |
parents | 24b9b6405f36 |
children | 3456b3ce0775 |
files | src/protocols/msn/msg.c |
diffstat | 1 files changed, 9 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/protocols/msn/msg.c Sat Nov 22 00:49:48 2003 +0000 +++ b/src/protocols/msn/msg.c Sat Nov 22 01:13:00 2003 +0000 @@ -235,6 +235,7 @@ { char header[48]; char footer[4]; + size_t body_len; msg->msnslp_message = TRUE; @@ -242,7 +243,14 @@ tmp += 48; - msg->body = g_memdup(tmp, msg->size - (tmp - msg_base) + 1); + body_len = msg->size - (tmp - msg_base); + gaim_debug_misc("msn", "Body len = %d\n", body_len); + msg->body = g_malloc(body_len + 1); + + if (body_len > 0) + memcpy(msg->body, tmp, body_len); + + msg->body[body_len] = '\0'; tmp++;