From 3d8ba053deeacd74e621469d3d45d1db38ee411a Mon Sep 17 00:00:00 2001 From: Jonathan Beck Date: Fri, 12 Dec 2008 23:39:33 +0100 Subject: Change from Base64 encoded buffers to real buffers. Base64 decoding/encoding only happens in xml plists. --- src/xplist.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/xplist.c') diff --git a/src/xplist.c b/src/xplist.c index 3e975f6..2d650b4 100644 --- a/src/xplist.c +++ b/src/xplist.c @@ -165,7 +165,9 @@ void node_to_xml(GNode * node, gpointer xml_struct) case PLIST_DATA: tag = "data"; - val = format_string(node_data->buff, 60, xstruct->depth); + gchar *valtmp = g_base64_encode(node_data->buff, node_data->length); + val = format_string(valtmp, 60, xstruct->depth); + g_free(valtmp); break; case PLIST_ARRAY: tag = "array"; @@ -267,7 +269,9 @@ void xml_to_node(xmlNodePtr xml_node, plist_t * plist_node) } if (!xmlStrcmp(node->name, "data")) { - data->buff = strdup(xmlNodeGetContent(node)); + gsize size = 0; + data->buff = g_base64_decode(xmlNodeGetContent(node), &size); + data->length = size; data->type = PLIST_DATA; continue; } -- cgit v1.1-32-gdbae