# HG changeset patch # User Christian Hammond # Date 1069463580 0 # Node ID 582f764b26f6303aa8119d12c66258a534332d38 # Parent 24b9b6405f367caa202df84693c1138547c80d1d [gaim-migrate @ 8210] This should better parse bodies in binary strings. committer: Tailor Script diff -r 24b9b6405f36 -r 582f764b26f6 src/protocols/msn/msg.c --- 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++;