summaryrefslogtreecommitdiffstats
path: root/test/plist_cmp.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2021-12-23 14:21:06 +0100
committerGravatar Nikias Bassen2021-12-23 14:21:06 +0100
commit914480a8771959bc2dc0f5e8e83365c15c05c36d (patch)
tree9edd0fb4701273d9ae237dc2e1c159bd122f44c5 /test/plist_cmp.c
parent24dcee30c5b74f32c90491f0c083a1c212cfe3a1 (diff)
downloadlibplist-914480a8771959bc2dc0f5e8e83365c15c05c36d.tar.gz
libplist-914480a8771959bc2dc0f5e8e83365c15c05c36d.tar.bz2
test: Work around JSON parser limitation expecting to have a 0-terminated string as input
Diffstat (limited to 'test/plist_cmp.c')
-rw-r--r--test/plist_cmp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/plist_cmp.c b/test/plist_cmp.c
index 85b92ee..2af3f63 100644
--- a/test/plist_cmp.c
+++ b/test/plist_cmp.c
@@ -124,6 +124,9 @@ int main(int argc, char *argv[])
fclose(iplist1);
fclose(iplist2);
+ plist_1[size_in1] = '\0';
+ plist_2[size_in2] = '\0';
+
if (memcmp(plist_1, "bplist00", 8) == 0)
plist_from_bin(plist_1, size_in1, &root_node1);
else if (plist_1[0] == '[' || plist_1[0] == '{')