summaryrefslogtreecommitdiffstats
path: root/src/bplist.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2021-12-19 16:13:07 +0100
committerGravatar Nikias Bassen2021-12-19 16:13:07 +0100
commit810e1a5936867a9f2c9f07df3a33a9d02fc03466 (patch)
treec561f0301b98a95fddc32259978345eed8eb5cc5 /src/bplist.c
parentc81471ce6e8821ba03427824217612dcab8e091b (diff)
downloadlibplist-810e1a5936867a9f2c9f07df3a33a9d02fc03466.tar.gz
libplist-810e1a5936867a9f2c9f07df3a33a9d02fc03466.tar.bz2
Add support for PLIST_NULL type
Diffstat (limited to 'src/bplist.c')
-rw-r--r--src/bplist.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/bplist.c b/src/bplist.c
index a41ce1a..a6e6ded 100644
--- a/src/bplist.c
+++ b/src/bplist.c
@@ -630,6 +630,13 @@ static plist_t parse_bin_node(struct bplist_data *bplist, const char** object)
}
case BPLIST_NULL:
+ {
+ plist_data_t data = plist_new_plist_data();
+ data->type = PLIST_NULL;
+ data->length = 0;
+ return node_create(NULL, data);
+ }
+
default:
return NULL;
}
@@ -1295,6 +1302,11 @@ PLIST_API void plist_to_bin(plist_t plist, char **plist_bin, uint32_t * length)
switch (data->type)
{
+ case PLIST_NULL: {
+ uint8_t b = 0;
+ byte_array_append(bplist_buff, &b, 1);
+ break;
+ }
case PLIST_BOOLEAN: {
uint8_t b = data->boolval ? BPLIST_TRUE : BPLIST_FALSE;
byte_array_append(bplist_buff, &b, 1);