diff options
author | Lucas De Marchi <lucas.demarchi@profusion.mobi> | 2012-10-06 04:02:36 -0300 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-10-06 09:44:26 +0200 |
commit | 6bcc5737a271345340960de18f2953295e7c4907 (patch) | |
tree | 7ea5c56259807a89f78c7c32506239a5d48fa902 | |
parent | 335bd95d00ccaf90fbe0296b048670e65ee1a9f0 (diff) | |
download | bluez-6bcc5737a271345340960de18f2953295e7c4907.tar.gz |
core: Remove useless memset and make icon optional
name is not being really used anywhere, so remove it together with the
memset from Device.GetProperties().
icon is optional, so check if it's not NULL before adding it to the list
of device properties.
-rw-r--r-- | src/device.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/device.c b/src/device.c index 656f109f7..3658eeb23 100644 --- a/src/device.c +++ b/src/device.c @@ -318,7 +318,7 @@ static DBusMessage *get_properties(DBusConnection *conn, DBusMessage *reply; DBusMessageIter iter; DBusMessageIter dict; - char name[MAX_NAME_LENGTH + 1], dstaddr[18]; + char dstaddr[18]; char **str; const char *ptr, *icon = NULL; dbus_bool_t boolean; @@ -345,9 +345,6 @@ static DBusMessage *get_properties(DBusConnection *conn, dict_append_entry(&dict, "Address", DBUS_TYPE_STRING, &ptr); /* Name */ - ptr = NULL; - memset(name, 0, sizeof(name)); - ptr = device->name; dict_append_entry(&dict, "Name", DBUS_TYPE_STRING, &ptr); @@ -375,7 +372,8 @@ static DBusMessage *get_properties(DBusConnection *conn, dict_append_entry(&dict, "Appearance", DBUS_TYPE_UINT16, &app); } - dict_append_entry(&dict, "Icon", DBUS_TYPE_STRING, &icon); + if (icon != NULL) + dict_append_entry(&dict, "Icon", DBUS_TYPE_STRING, &icon); /* Vendor */ if (device->vendor) |