Skip to contentSkip to conversation

knownnetworks: Check result of setting getter

PATCH Applied Tim Kourt 2 participants 2 messages Oct 29, 2019 – Oct 30, 2019

lore
Share & tools
lore

Tim Kourt

author
#0 lore raw

PATCH 1/1 knownnetworks: Check result of setting getter

Set the value of 'is_hidden' if necessary.

---
 src/knownnetworks.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
src/knownnetworks.c +3 -2
index e5cbc01b..d8d6947d 100644
@@ -338,7 +338,7 @@ void known_network_update(struct network_info *network,
 					struct l_settings *settings,
 					uint64_t connected_time)
 {
-	bool is_hidden = false;
+	bool is_hidden;
 	bool is_autoconnectable;
 
 	if (network->connected_time != connected_time) {
@@ -354,7 +354,8 @@ void known_network_update(struct network_info *network,
 
 	network->connected_time = connected_time;
 
-	l_settings_get_bool(settings, "Settings", "Hidden", &is_hidden);
+	if (!l_settings_get_bool(settings, "Settings", "Hidden", &is_hidden))
+		is_hidden = false;
 
 	if (network->is_hidden != is_hidden) {
 		if (network->is_hidden && !is_hidden)
Signature · 1 line
2.13.6
#1 lore raw

Hi Tim,

Quoted 5 lines · Tim Kourt

Set the value of 'is_hidden' if necessary.

---
  src/knownnetworks.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)

Applied, thanks.

Regards,
-Denis