--- src/adapter.c | 3 +-- src/glib-helper.c | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/adapter.c b/src/adapter.c index 102aad7..b581674 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -3142,8 +3142,7 @@ void adapter_update_device_from_info(struct btd_adapter *adapter, (GCompareFunc) dev_rssi_cmp); if (info->length) { - uint8_t type; - char *tmp_name = bt_extract_eir_name(info->data, &type); + char *tmp_name = bt_extract_eir_name(info->data, NULL); if (tmp_name) { g_free(dev->name); dev->name = tmp_name; diff --git a/src/glib-helper.c b/src/glib-helper.c index 927fb7c..e71841b 100644 --- a/src/glib-helper.c +++ b/src/glib-helper.c @@ -744,9 +744,10 @@ char *bt_extract_eir_name(uint8_t *data, uint8_t *type) if (data[0] == 0) return NULL; - *type = data[1]; + if (type) + *type = data[1]; - switch (*type) { + switch (data[1]) { case EIR_NAME_SHORT: case EIR_NAME_COMPLETE: if (!g_utf8_validate((char *) (data + 2), data[0] - 1, NULL)) -- 1.7.3.2 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html