chiark / gitweb /
bus: allow to specify NULL as an empty string to add
authorKay Sievers <kay@vrfy.org>
Sun, 20 Oct 2013 22:18:00 +0000 (00:18 +0200)
committerKay Sievers <kay@vrfy.org>
Sun, 20 Oct 2013 22:21:27 +0000 (00:21 +0200)
src/libsystemd-bus/bus-objects.c

index 0c935e947d89e9e44b36c53676bd72778a474f0c..90417fdca196493a4ea992416ea47492672e683a 100644 (file)
@@ -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;