# HG changeset patch # User Will Thompson # Date 1218455892 0 # Node ID 187b0e2ff49decfabc93828f43b71524c50bcb12 # Parent 80ce5ca985c2072ab11a94c50e578f8cc08f1c15 Rely on xmlnode_insert_data to call strlen on a bunch of MSN status strings. This has the side-effect of not triggering g_return_if_fail(length != 0) in xmlnode_insert_data when you update your buddy icon and don't have a status message, in which case msn_build_psm used to call insert_data("", 0). Perhaps xmlnode_insert_data should short-circuit without logging an error if length == 0? diff -r 80ce5ca985c2 -r 187b0e2ff49d libpurple/protocols/msn/state.c --- a/libpurple/protocols/msn/state.c Sun Aug 10 21:49:23 2008 +0000 +++ b/libpurple/protocols/msn/state.c Mon Aug 11 11:58:12 2008 +0000 @@ -61,23 +61,23 @@ psmNode = xmlnode_new("PSM"); if(psmstr != NULL){ - xmlnode_insert_data(psmNode,psmstr,strlen(psmstr)); + xmlnode_insert_data(psmNode, psmstr, -1); } - xmlnode_insert_child(dataNode,psmNode); + xmlnode_insert_child(dataNode, psmNode); mediaNode = xmlnode_new("CurrentMedia"); if(mediastr != NULL){ - xmlnode_insert_data(mediaNode,mediastr,strlen(mediastr)); + xmlnode_insert_data(mediaNode, mediastr, -1); } - xmlnode_insert_child(dataNode,mediaNode); + xmlnode_insert_child(dataNode, mediaNode); guidNode = xmlnode_new("MachineGuid"); if(guidstr != NULL){ - xmlnode_insert_data(guidNode,guidstr,strlen(guidstr)); + xmlnode_insert_data(guidNode, guidstr, -1); } - xmlnode_insert_child(dataNode,guidNode); + xmlnode_insert_child(dataNode, guidNode); - result = xmlnode_to_str(dataNode,&length); + result = xmlnode_to_str(dataNode, &length); xmlnode_free(dataNode); return result; }