diff options
author | gitjackolantern <scottjconover@yahoo.com> | 2015-08-31 17:44:08 -0700 |
---|---|---|
committer | gitjackolantern <scottjconover@yahoo.com> | 2015-08-31 17:44:08 -0700 |
commit | aead674b06db629905a9848e5c1f3efd69e53c44 (patch) | |
tree | eb8cc5d6dea753c882a2791626f96c6acb51680d | |
parent | 0cb4ed0cdb88373f255bfc94e6b236e444ab24a7 (diff) | |
parent | 496d012334f7eb1b0a5cadbe76894d8588827f2a (diff) | |
download | bluez-tools-aead674b06db629905a9848e5c1f3efd69e53c44.tar.gz |
Merge pull request #4 from syntheticpp/master
fix crash, dbus call
-rw-r--r-- | src/lib/agent-helper.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/agent-helper.c b/src/lib/agent-helper.c index 5269005..740a8ed 100644 --- a/src/lib/agent-helper.c +++ b/src/lib/agent-helper.c @@ -279,7 +279,7 @@ static void _bt_agent_method_call_func(GDBusConnection *connection, const gchar GError *error = NULL; Device *device_obj = device_new(g_variant_get_string(g_variant_get_child_value(parameters, 0), NULL)); const gchar *pin = _find_device_pin(device_get_dbus_object_path(device_obj)); - const gchar *ret = NULL; + const gchar ret[16]; if (_interactive) g_print("Device: %s (%s)\n", device_get_alias(device_obj, &error), device_get_address(device_obj, &error)); @@ -307,7 +307,9 @@ static void _bt_agent_method_call_func(GDBusConnection *connection, const gchar errno = 0; if (scanf("%s", &ret) == EOF && errno) g_warning("%s\n", strerror(errno)); - g_dbus_method_invocation_return_value(invocation, g_variant_new_string(ret)); + GVariant* vars[1]; + vars[0] = g_variant_new_string(ret); + g_dbus_method_invocation_return_value(invocation, g_variant_new_tuple(vars, 1)); return; } |