From 224a1ed4c152c394d42b8a6fd78159af400d5df3 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 10 Dec 2013 03:04:16 +0100 Subject: bus: empty gvariant arrays should at least get size 1 --- src/libsystemd-bus/bus-message.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/libsystemd-bus') diff --git a/src/libsystemd-bus/bus-message.c b/src/libsystemd-bus/bus-message.c index 32af8609b3..4488e7b6b3 100644 --- a/src/libsystemd-bus/bus-message.c +++ b/src/libsystemd-bus/bus-message.c @@ -1894,9 +1894,7 @@ _public_ int sd_bus_message_open_container( } static size_t determine_word_size(size_t sz, size_t extra) { - if (sz <= 0 && extra == 0) - return 0; - else if (sz + extra <= 0xFF) + if (sz + extra <= 0xFF) return 1; else if (sz + extra*2 <= 0xFFFF) return 2; -- cgit v1.2.3-54-g00ecf