summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Jonathan Beck2008-08-31 22:50:37 +0200
committerGravatar Jonathan Beck2008-11-24 22:49:23 +0100
commit0bca81e7c8ce5ba53390271e5c7eaa7a5f281c91 (patch)
treefff1056012c95ad89e3816c0c14cabed8dfbc42a
parentf4c4b783c8dbe2fe8e7e6f6b5f19f0d44b489c9a (diff)
downloadlibimobiledevice-0bca81e7c8ce5ba53390271e5c7eaa7a5f281c91.tar.gz
libimobiledevice-0bca81e7c8ce5ba53390271e5c7eaa7a5f281c91.tar.bz2
Output binary data base64 encoded (and 60 cols wide)
-rw-r--r--dev/plutil.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/dev/plutil.c b/dev/plutil.c
index 208d7df..1c7b140 100644
--- a/dev/plutil.c
+++ b/dev/plutil.c
@@ -45,12 +45,19 @@ void print_nodes(bplist_node *root_node) {
break;
case BPLIST_STRING:
- case BPLIST_DATA:
- printf("String/data: ");
+ printf("String: ");
fwrite(root_node->strval, sizeof(char), root_node->length, stdout);
fflush(stdout);
printf("\n");
break;
+
+ case BPLIST_DATA:
+ printf("Data: ");
+ char* data = g_base64_encode(root_node->strval,root_node->length);
+ fwrite(format_string(data, 60, 0), sizeof(char), strlen(data), stdout);
+ fflush(stdout);
+ printf("\n");
+ break;
case BPLIST_UNICODE:
printf("Unicode data, may appear crappy: ");