summaryrefslogtreecommitdiff
path: root/client/gatt.c
diff options
context:
space:
mode:
authorERAMOTO Masaya <eramoto.masaya@jp.fujitsu.com>2017-12-28 14:44:18 +0900
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2018-01-02 14:15:54 -0200
commit203f5cb2f03c3708bb79cecb8b448b87e3ce7c88 (patch)
tree2e8a7168e32529e3d4a693fb5aafdf334f4432ed /client/gatt.c
parent529790b6a5d599b961469a7c800b164a2e5d3388 (diff)
downloadbluez-203f5cb2f03c3708bb79cecb8b448b87e3ce7c88.tar.gz
client: Use g_dbus_proxy_path_lookup()
Diffstat (limited to 'client/gatt.c')
-rw-r--r--client/gatt.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/client/gatt.c b/client/gatt.c
index 3d0222e63..4d51e053c 100644
--- a/client/gatt.c
+++ b/client/gatt.c
@@ -445,28 +445,13 @@ GDBusProxy *gatt_select_attribute(GDBusProxy *parent, const char *arg)
static char *attribute_generator(const char *text, int state, GList *source)
{
- static int index, len;
- GList *list;
+ static int index;
if (!state) {
index = 0;
- len = strlen(text);
}
- for (list = g_list_nth(source, index); list;
- list = g_list_next(list)) {
- GDBusProxy *proxy = list->data;
- const char *path;
-
- index++;
-
- path = g_dbus_proxy_get_path(proxy);
-
- if (!strncmp(path, text, len))
- return strdup(path);
- }
-
- return NULL;
+ return g_dbus_proxy_path_lookup(source, &index, text);
}
char *gatt_attribute_generator(const char *text, int state)