diff options
-rwxr-xr-x | client/ins.c | 22 | ||||
-rwxr-xr-x | src/service.c | 18 |
2 files changed, 19 insertions, 21 deletions
diff --git a/client/ins.c b/client/ins.c index 6403f610..929c6a93 100755 --- a/client/ins.c +++ b/client/ins.c @@ -95,7 +95,7 @@ static GSList *get_bssid_list(DBusMessageIter *iter, struct ins_info_s *ins_info if (strcmp(property, "BSSID") == 0) { bssid_info = g_try_new0(struct bssid_info_s, 1); if (!bssid_info) - continue; + break; dbus_message_iter_next(&entry); dbus_message_iter_recurse(&entry, &val); @@ -157,19 +157,19 @@ static void print_ins_info(int *rank, struct ins_info_s *ins_info, char *path, char *filter, DBusMessageIter *iter) { char *name = ""; - char *security; + char *security = ""; char *str = NULL; int count = 0; char *property; - unsigned char strength; - unsigned int frequency; - int score_INS; - int score_last_user_selection; - int score_last_connected; - int score_frequency; - int score_security_priority; - int score_internet_connection; - int score_strength; + unsigned char strength = 0; + unsigned int frequency = 0; + int score_INS = 0; + int score_last_user_selection = 0; + int score_last_connected = 0; + int score_frequency = 0; + int score_security_priority = 0; + int score_internet_connection = 0; + int score_strength = 0; GSList *bssid_list = NULL; DBusMessageIter entry, val, dict; diff --git a/src/service.c b/src/service.c index b5e099d1..148cf0e5 100755 --- a/src/service.c +++ b/src/service.c @@ -8118,16 +8118,14 @@ static int calculate_score_last_connected(struct connman_service *service) frequency = connman_network_get_frequency(service->network); if (ins_settings.last_connected) { - if (ins_settings.last_connected) { - if (g_strcmp0(last_connected_ident, service->identifier) == 0 && - (((frequency >= FREQ_RANGE_24GHZ_CHANNEL_1 && - frequency <= FREQ_RANGE_24GHZ_CHANNEL_14) && - service->strength >= ins_settings.signal_level3_24ghz) || - ((frequency >= FREQ_RANGE_5GHZ_CHANNEL_32 && - frequency <= FREQ_RANGE_5GHZ_CHANNEL_165) && - service->strength >= ins_settings.signal_level3_5ghz))) { - score += ins_settings.last_connected_score; - } + if (g_strcmp0(last_connected_ident, service->identifier) == 0 && + (((frequency >= FREQ_RANGE_24GHZ_CHANNEL_1 && + frequency <= FREQ_RANGE_24GHZ_CHANNEL_14) && + service->strength >= ins_settings.signal_level3_24ghz) || + ((frequency >= FREQ_RANGE_5GHZ_CHANNEL_32 && + frequency <= FREQ_RANGE_5GHZ_CHANNEL_165) && + service->strength >= ins_settings.signal_level3_5ghz))) { + score += ins_settings.last_connected_score; } } |