Mercurial > pidgin
comparison src/protocols/msn/msg.c @ 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 | 3a48ade4f510 |
children | 43803965ef45 |
comparison
equal
deleted
inserted
replaced
7591:24b9b6405f36 | 7592:582f764b26f6 |
---|---|
233 /* Now we *should* be at the body. */ | 233 /* Now we *should* be at the body. */ |
234 if (!strcmp(msn_message_get_content_type(msg), "application/x-msnmsgrp2p")) | 234 if (!strcmp(msn_message_get_content_type(msg), "application/x-msnmsgrp2p")) |
235 { | 235 { |
236 char header[48]; | 236 char header[48]; |
237 char footer[4]; | 237 char footer[4]; |
238 size_t body_len; | |
238 | 239 |
239 msg->msnslp_message = TRUE; | 240 msg->msnslp_message = TRUE; |
240 | 241 |
241 memcpy(header, tmp, 48); | 242 memcpy(header, tmp, 48); |
242 | 243 |
243 tmp += 48; | 244 tmp += 48; |
244 | 245 |
245 msg->body = g_memdup(tmp, msg->size - (tmp - msg_base) + 1); | 246 body_len = msg->size - (tmp - msg_base); |
247 gaim_debug_misc("msn", "Body len = %d\n", body_len); | |
248 msg->body = g_malloc(body_len + 1); | |
249 | |
250 if (body_len > 0) | |
251 memcpy(msg->body, tmp, body_len); | |
252 | |
253 msg->body[body_len] = '\0'; | |
246 | 254 |
247 tmp++; | 255 tmp++; |
248 | 256 |
249 memcpy(footer, tmp, 4); | 257 memcpy(footer, tmp, 4); |
250 | 258 |