aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/dbus/dbus_new_handlers_p2p.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2016-12-23 09:22:00 (GMT)
committerJouni Malinen <j@w1.fi>2016-12-23 19:28:43 (GMT)
commit77fcbf7ff185ae304b95b9fe8c84d7cdd51f3b9a (patch)
tree98f338194e9c739533d8488c8cc614564067e32c /wpa_supplicant/dbus/dbus_new_handlers_p2p.c
parentdbf524946b1a0eff6a16dd977eba1a6270b49c83 (diff)
downloadhostap-77fcbf7ff185ae304b95b9fe8c84d7cdd51f3b9a.zip
hostap-77fcbf7ff185ae304b95b9fe8c84d7cdd51f3b9a.tar.gz
hostap-77fcbf7ff185ae304b95b9fe8c84d7cdd51f3b9a.tar.bz2
D-Bus: Use a helper function to get possibly NULL strings
This type of check is used in quite a few getter functions, so add a helper function to take care of it. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/dbus/dbus_new_handlers_p2p.c')
-rw-r--r--wpa_supplicant/dbus/dbus_new_handlers_p2p.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/wpa_supplicant/dbus/dbus_new_handlers_p2p.c b/wpa_supplicant/dbus/dbus_new_handlers_p2p.c
index 4c91ee5..a04783d 100644
--- a/wpa_supplicant/dbus/dbus_new_handlers_p2p.c
+++ b/wpa_supplicant/dbus/dbus_new_handlers_p2p.c
@@ -2352,19 +2352,12 @@ dbus_bool_t wpas_dbus_getter_p2p_group_passphrase(
DBusMessageIter *iter, DBusError *error, void *user_data)
{
struct wpa_supplicant *wpa_s = user_data;
- char *p_pass;
struct wpa_ssid *ssid = wpa_s->current_ssid;
if (ssid == NULL)
return FALSE;
- p_pass = ssid->passphrase;
- if (!p_pass)
- p_pass = "";
-
- return wpas_dbus_simple_property_getter(iter, DBUS_TYPE_STRING,
- &p_pass, error);
-
+ return wpas_dbus_string_property_getter(iter, ssid->passphrase, error);
}