From f1222e7d8ca3e3c258304a2dc39db685dd9968bc Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Thu, 2 Feb 2017 01:12:35 -0500 Subject: [PATCH] component.c: return NULL when there's no name, not "" MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- lib/component/component.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/component/component.c b/lib/component/component.c index 89179f23..c2290a86 100644 --- a/lib/component/component.c +++ b/lib/component/component.c @@ -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; } -- 2.34.1