diff options
author | Jonathan Beck | 2009-02-14 14:41:54 +0100 |
---|---|---|
committer | Jonathan Beck | 2009-02-14 14:41:54 +0100 |
commit | 461c947d1238a1ca5604ec34bd4fe84e040334f7 (patch) | |
tree | 1cb0f126cb71e400f48ee02e13ea90afb41b7f7b /src/xplist.c | |
parent | 7139de793c8debdf9c18a7eb96f0551feee4c598 (diff) | |
download | libplist-461c947d1238a1ca5604ec34bd4fe84e040334f7.tar.gz libplist-461c947d1238a1ca5604ec34bd4fe84e040334f7.tar.bz2 |
Only call g_base64_encode if there is data to encode.
Diffstat (limited to 'src/xplist.c')
-rw-r--r-- | src/xplist.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/xplist.c b/src/xplist.c index b404e79..e985243 100644 --- a/src/xplist.c +++ b/src/xplist.c @@ -190,9 +190,11 @@ static void node_to_xml(GNode * node, gpointer xml_struct) case PLIST_DATA: tag = XPLIST_DATA; - valtmp = g_base64_encode(node_data->buff, node_data->length); - val = format_string(valtmp, 60, xstruct->depth); - g_free(valtmp); + if (node_data->length) { + 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 = XPLIST_ARRAY; |