diff options
Diffstat (limited to 'src/print_wireless_info.c')
-rw-r--r-- | src/print_wireless_info.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/print_wireless_info.c b/src/print_wireless_info.c index c3b5270..dcfde52 100644 --- a/src/print_wireless_info.c +++ b/src/print_wireless_info.c @@ -16,6 +16,7 @@ #endif #ifdef __APPLE__ +#include <sys/socket.h> #define IW_ESSID_MAX_SIZE 32 #endif @@ -479,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; @@ -539,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 { |