diff options
Diffstat (limited to 'info_scr.c')
-rw-r--r-- | info_scr.c | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -78,13 +78,15 @@ static void display_levels(void) char tmp[0x100]; int line; bool noise_data_valid; - int sig_qual = -1, sig_qual_max, sig_level; + int sig_qual = -1, sig_qual_max = 0, sig_level = 0; noise_data_valid = iw_nl80211_have_survey_data(&linkstat.data); - sig_level = linkstat.data.signal_avg ?: linkstat.data.signal; + sig_level = linkstat.data.signal; /* See comments in iw_cache_update */ if (sig_level == 0) + sig_level = linkstat.data.signal_avg; + if (sig_level == 0) sig_level = linkstat.data.bss_signal; for (line = 1; line <= WH_LEVEL; line++) @@ -173,7 +175,7 @@ static void display_levels(void) static void display_stats(void) { - char tmp[0x100]; + char tmp[0x120]; /* * Interface RX stats @@ -181,7 +183,7 @@ static void display_stats(void) mvwaddstr(w_stats, 1, 1, "RX: "); if (linkstat.data.rx_packets) { - sprintf(tmp, "%'u (%s)", linkstat.data.rx_packets, + sprintf(tmp, "%s (%s)", int_counts(linkstat.data.rx_packets), byte_units(linkstat.data.rx_bytes)); waddstr_b(w_stats, tmp); } else { @@ -218,7 +220,7 @@ static void display_stats(void) mvwaddstr(w_stats, 2, 1, "TX: "); if (linkstat.data.tx_packets) { - sprintf(tmp, "%'u (%s)", linkstat.data.tx_packets, + sprintf(tmp, "%s (%s)", int_counts(linkstat.data.tx_packets), byte_units(linkstat.data.tx_bytes)); waddstr_b(w_stats, tmp); } else { @@ -232,15 +234,14 @@ static void display_stats(void) if (linkstat.data.tx_retries) { waddstr(w_stats, ", retries: "); - sprintf(tmp, "%'u (%.1f%%)", linkstat.data.tx_retries, + sprintf(tmp, "%s (%.1f%%)", int_counts(linkstat.data.tx_retries), (1e2 * linkstat.data.tx_retries)/linkstat.data.tx_packets); waddstr_b(w_stats, tmp); } if (linkstat.data.tx_failed) { waddstr(w_stats, ", failed: "); - sprintf(tmp, "%'u", linkstat.data.tx_failed); - waddstr_b(w_stats, tmp); + waddstr_b(w_stats, int_counts(linkstat.data.tx_failed)); } wclrtoborder(w_stats); wrefresh(w_stats); @@ -421,8 +422,7 @@ static void display_info(WINDOW *w_if, WINDOW *w_info) if (linkstat.data.beacon_loss) { waddstr(w_info, ", lost: "); - sprintf(tmp, "%'u", linkstat.data.beacon_loss); - waddstr_b(w_info, tmp); + waddstr_b(w_info, int_counts(linkstat.data.beacon_loss)); } waddstr(w_info, ", avg sig: "); sprintf(tmp, "%d dBm", (int8_t)linkstat.data.beacon_avg_sig); |