summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIngo Bürk <admin@airblader.de>2018-06-29 23:10:53 +0200
committerGitHub <noreply@github.com>2018-06-29 23:10:53 +0200
commit302966374bd7d9ca5b97171cedd3613ae10360c8 (patch)
tree1e8afe30232b17abdbb86c67bddefea99e450a12 /src
parent78c0a53c45428a9671c2d0c38dc5483f66465bf2 (diff)
parent4ea804b751f9394b7b10b520212169a491c698a6 (diff)
Merge pull request #292 from Stunkymonkey/format_quality
add format_quality option in wireless
Diffstat (limited to 'src')
-rw-r--r--src/print_wireless_info.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/print_wireless_info.c b/src/print_wireless_info.c
index efdd59b..dcfde52 100644
--- a/src/print_wireless_info.c
+++ b/src/print_wireless_info.c
@@ -480,7 +480,7 @@ error1:
* | 127.0.0.1 | no IP | IPv4 | ok |
* | 127.0.0.1 | ::1/128 | IPv4 | ok |
*/
-void print_wireless_info(yajl_gen json_gen, char *buffer, const char *interface, const char *format_up, const char *format_down) {
+void print_wireless_info(yajl_gen json_gen, char *buffer, const char *interface, const char *format_up, const char *format_down, const char *format_quality) {
const char *walk;
char *outwalk = buffer;
wireless_info_t info;
@@ -540,7 +540,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, "%3d%s", PERCENT_VALUE(info.quality, info.quality_max), pct_mark);
+ outwalk += sprintf(outwalk, format_quality, PERCENT_VALUE(info.quality, info.quality_max), pct_mark);
else
outwalk += sprintf(outwalk, "%d", info.quality);
} else {