From e61fc2565eb12d22600b19f58380d5a840b47165 Mon Sep 17 00:00:00 2001 From: Andrei Emeltchenko Date: Mon, 23 Jun 2014 14:19:35 +0300 Subject: [PATCH] core: Fix using address of array instead of size The dev->name variable is an array, so the address of it can never be NULL. --- src/device.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/device.c b/src/device.c index a9b644be7..2c9ff9296 100644 --- a/src/device.c +++ b/src/device.c @@ -593,9 +593,8 @@ static gboolean dev_property_get_name(const GDBusPropertyTable *property, DBusMessageIter *iter, void *data) { struct btd_device *device = data; - const char *empty = "", *ptr; + const char *ptr = device->name; - ptr = device->name ?: empty; dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &ptr); return TRUE; -- 2.47.3