summaryrefslogtreecommitdiff
path: root/src/device.c
diff options
context:
space:
mode:
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>2014-06-23 14:19:35 +0300
committerJohan Hedberg <johan.hedberg@intel.com>2014-06-23 14:37:28 +0300
commite61fc2565eb12d22600b19f58380d5a840b47165 (patch)
tree68dece15743ba05545e25047bedeae5f40fb9fdc /src/device.c
parent7d4d7bec3812d8c207f741228408d7f0c1a3c469 (diff)
downloadbluez-e61fc2565eb12d22600b19f58380d5a840b47165.tar.gz
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.
Diffstat (limited to 'src/device.c')
-rw-r--r--src/device.c3
1 files changed, 1 insertions, 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;