diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2015-04-14 17:42:38 +0300 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2015-04-17 14:15:47 +0300 |
commit | 9797b12a39dec20f8da037f1266a3093d12a02a3 (patch) | |
tree | c4ca0c3d936d7f03ec11f8f2295f195770dff28c /client | |
parent | 4a7e909f2cc387367e1eb2b14f34e7f871566441 (diff) | |
download | bluez-9797b12a39dec20f8da037f1266a3093d12a02a3.tar.gz |
client: Fix no handling dict properly
D-Bus dict may contain keys that are not of string type.
Diffstat (limited to 'client')
-rw-r--r-- | client/main.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/client/main.c b/client/main.c index bb67f3d5b..1e76aef4b 100644 --- a/client/main.c +++ b/client/main.c @@ -162,6 +162,7 @@ static void print_iter(const char *label, const char *name, unsigned char byte; const char *valstr; DBusMessageIter subiter; + char *entry; if (iter == NULL) { rl_printf("%s%s is nil\n", label, name); @@ -212,9 +213,14 @@ static void print_iter(const char *label, const char *name, break; case DBUS_TYPE_DICT_ENTRY: dbus_message_iter_recurse(iter, &subiter); - dbus_message_iter_get_basic(&subiter, &valstr); + entry = g_strconcat(name, " Key", NULL); + print_iter(label, entry, &subiter); + g_free(entry); + + entry = g_strconcat(name, " Value", NULL); dbus_message_iter_next(&subiter); - print_iter(label, valstr, &subiter); + print_iter(label, entry, &subiter); + g_free(entry); break; default: rl_printf("%s%s has unsupported type\n", label, name); |