comparison src/protocols/msn/msg.c @ 5478:bae3c48b9b4c

[gaim-migrate @ 5874] Fixed a debug warning. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Thu, 22 May 2003 10:20:54 +0000
parents f9658a84d1ed
children 4f72b611f0ee
comparison
equal deleted inserted replaced
5477:e8e498255369 5478:bae3c48b9b4c
390 390
391 void 391 void
392 msn_message_set_content_type(MsnMessage *msg, const char *type) 392 msn_message_set_content_type(MsnMessage *msg, const char *type)
393 { 393 {
394 g_return_if_fail(msg != NULL); 394 g_return_if_fail(msg != NULL);
395 g_return_if_fail(type != NULL);
396 395
397 if (msg->content_type != NULL) { 396 if (msg->content_type != NULL) {
398 msg->size -= strlen(msg->content_type); 397 msg->size -= strlen(msg->content_type);
399 g_free(msg->content_type); 398 g_free(msg->content_type);
400 } 399 }
401 400
402 msg->content_type = g_strdup(type); 401 if (type != NULL) {
403 402 msg->content_type = g_strdup(type);
404 msg->size += strlen(type); 403
404 msg->size += strlen(type);
405 }
406 else
407 msg->content_type = NULL;
405 } 408 }
406 409
407 const char * 410 const char *
408 msn_message_get_content_type(const MsnMessage *msg) 411 msn_message_get_content_type(const MsnMessage *msg)
409 { 412 {