component.c: return NULL when there's no name, not ""
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 2 Feb 2017 06:12:35 +0000 (01:12 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 28 May 2017 16:57:37 +0000 (12:57 -0400)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
lib/component/component.c

index 89179f23d5321727489cb2de993a28d9cb52355a..c2290a86e23228ee2702221c86cc1e5eb111be87 100644 (file)
@@ -249,7 +249,7 @@ const char *bt_component_get_name(struct bt_component *component)
                goto end;
        }
 
-       ret = component->name->str;
+       ret = component->name->len == 0 ? NULL : component->name->str;
 end:
        return ret;
 }
This page took 0.055823 seconds and 4 git commands to generate.