summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJon Bernard <jbernard@users.noreply.github.com>2016-11-12 09:39:41 -0500
committerMichael Stapelberg <stapelberg@users.noreply.github.com>2016-11-12 06:39:41 -0800
commit220b9e156527463512862f59b2413702d3ef6a3f (patch)
tree831c10761fa7c637eef8689adf73aefabd19dde3 /src
parentbe87c5ac3881886b2274dc270535d34c4eb82bf3 (diff)
Use blank padding for wireless quality (#166) (#167)
Diffstat (limited to 'src')
-rw-r--r--src/print_wireless_info.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/print_wireless_info.c b/src/print_wireless_info.c
index 15ac694..6db6488 100644
--- a/src/print_wireless_info.c
+++ b/src/print_wireless_info.c
@@ -497,7 +497,7 @@ void print_wireless_info(yajl_gen json_gen, char *buffer, const char *interface,
if (BEGINS_WITH(walk + 1, "quality")) {
if (info.flags & WIRELESS_INFO_FLAG_HAS_QUALITY) {
if (info.quality_max)
- outwalk += sprintf(outwalk, "%03d%s", PERCENT_VALUE(info.quality, info.quality_max), pct_mark);
+ outwalk += sprintf(outwalk, "%3d%s", PERCENT_VALUE(info.quality, info.quality_max), pct_mark);
else
outwalk += sprintf(outwalk, "%d", info.quality);
} else {
@@ -509,7 +509,7 @@ void print_wireless_info(yajl_gen json_gen, char *buffer, const char *interface,
if (BEGINS_WITH(walk + 1, "signal")) {
if (info.flags & WIRELESS_INFO_FLAG_HAS_SIGNAL) {
if (info.signal_level_max)
- outwalk += sprintf(outwalk, "%03d%s", PERCENT_VALUE(info.signal_level, info.signal_level_max), pct_mark);
+ outwalk += sprintf(outwalk, "%3d%s", PERCENT_VALUE(info.signal_level, info.signal_level_max), pct_mark);
else
outwalk += sprintf(outwalk, "%d dBm", info.signal_level);
} else {
@@ -521,7 +521,7 @@ void print_wireless_info(yajl_gen json_gen, char *buffer, const char *interface,
if (BEGINS_WITH(walk + 1, "noise")) {
if (info.flags & WIRELESS_INFO_FLAG_HAS_NOISE) {
if (info.noise_level_max)
- outwalk += sprintf(outwalk, "%03d%s", PERCENT_VALUE(info.noise_level, info.noise_level_max), pct_mark);
+ outwalk += sprintf(outwalk, "%3d%s", PERCENT_VALUE(info.noise_level, info.noise_level_max), pct_mark);
else
outwalk += sprintf(outwalk, "%d dBm", info.noise_level);
} else {