pidgin: 50c98867: Rely on xmlnode_insert_data to call strl...

resiak at pidgin.im resiak at pidgin.im
Mon Aug 11 08:01:30 EDT 2008


-----------------------------------------------------------------
Revision: 50c9886707d55a226f4685caa6f412215c72e432
Ancestor: a9002d08e75602ce9bcf87e60a05f2b0c7862608
Author: resiak at pidgin.im
Date: 2008-08-11T11:58:12
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/50c9886707d55a226f4685caa6f412215c72e432

Modified files:
        libpurple/protocols/msn/state.c

ChangeLog: 

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?


-------------- next part --------------
============================================================
--- libpurple/protocols/msn/state.c	574b93addabdd165576c0b962547aaadb180b762
+++ libpurple/protocols/msn/state.c	ee5bc683c1944f5b60597bfb8b7ae3497b545cd9
@@ -61,23 +61,23 @@ msn_build_psm(const char *psmstr,const c
 
 	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;
 }


More information about the Commits mailing list