summaryrefslogtreecommitdiffstats
path: root/src/xplist.c
diff options
context:
space:
mode:
authorGravatar Jonathan Beck2008-12-12 23:39:33 +0100
committerGravatar Jonathan Beck2008-12-12 23:39:33 +0100
commit3d8ba053deeacd74e621469d3d45d1db38ee411a (patch)
tree9c2010c9da179f96d55988f19c861301a68e5eb4 /src/xplist.c
parent9ca887308d59e6cb5bf684f9f3bd968118e8014f (diff)
downloadlibimobiledevice-3d8ba053deeacd74e621469d3d45d1db38ee411a.tar.gz
libimobiledevice-3d8ba053deeacd74e621469d3d45d1db38ee411a.tar.bz2
Change from Base64 encoded buffers to real buffers. Base64 decoding/encoding only happens in xml plists.
Diffstat (limited to 'src/xplist.c')
-rw-r--r--src/xplist.c8
1 files changed, 6 insertions, 2 deletions
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;
}