summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/bus-objects.c
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2013-10-21 00:18:00 +0200
committerKay Sievers <kay@vrfy.org>2013-10-21 00:21:27 +0200
commitaf8601fa8b035426bba7916ebe08e4568d2e2cbd (patch)
tree79def3281db2e90f4d3ffe5a13d93118188064da /src/libsystemd-bus/bus-objects.c
parentf24e86530ce0645e88022497af7d238f9c366946 (diff)
bus: allow to specify NULL as an empty string to add
Diffstat (limited to 'src/libsystemd-bus/bus-objects.c')
-rw-r--r--src/libsystemd-bus/bus-objects.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libsystemd-bus/bus-objects.c b/src/libsystemd-bus/bus-objects.c
index 0c935e947d..90417fdca1 100644
--- a/src/libsystemd-bus/bus-objects.c
+++ b/src/libsystemd-bus/bus-objects.c
@@ -313,7 +313,7 @@ static int invoke_property_get(
void *userdata) {
int r;
- void *p;
+ const void *p;
assert(bus);
assert(v);
@@ -333,6 +333,11 @@ static int invoke_property_get(
switch (v->x.property.signature[0]) {
case SD_BUS_TYPE_STRING:
+ p = *(char**) userdata;
+ if (!p)
+ p = "";
+ break;
+
case SD_BUS_TYPE_OBJECT_PATH:
case SD_BUS_TYPE_SIGNATURE:
p = *(char**) userdata;