diff options
author | Szymon Janc <szymon@janc.net.pl> | 2013-02-06 22:40:37 +0100 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2013-02-15 12:48:35 +0200 |
commit | f0c8fed3060150f436ebd9e59e45b262cde89bae (patch) | |
tree | 44536929ac2b5916ffc2d2b6b41f76767b6afa21 /plugins/hostname.c | |
parent | c13aee2b1fd045df0e5181f70d574fec99b26b3a (diff) | |
download | bluez-f0c8fed3060150f436ebd9e59e45b262cde89bae.tar.gz |
hostname: Fix setting adapter name to empty string
If pretty hostname is not set empty string is received. Don't update
adapters' names is such case.
Diffstat (limited to 'plugins/hostname.c')
-rw-r--r-- | plugins/hostname.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/hostname.c b/plugins/hostname.c index 0b75fac20..74c25df5b 100644 --- a/plugins/hostname.c +++ b/plugins/hostname.c @@ -117,6 +117,12 @@ static void property_changed(GDBusProxy *proxy, const char *name, DBG("pretty hostname: %s", str); + if (g_str_equal(str, "") == TRUE) { + g_free(pretty_hostname); + pretty_hostname = NULL; + return; + } + g_free(pretty_hostname); pretty_hostname = g_strdup(str); |