From: Daniel Golle Date: Tue, 5 Jan 2021 15:09:40 +0000 (+0000) Subject: cli: account for additional digit for frequencies above 10GHz X-Git-Url: http://git.openwrt.org/project/luci.git;master?a=commitdiff_plain;h=74d13fb98730a7a8af6e6662d0f4281b6655ddd0;p=project%2Fiwinfo.git cli: account for additional digit for frequencies above 10GHz When using 802.11ad, the frequency string will no longer fit in the preallocated buffer of 10 bytes. In the best case this leads to the 'z' character being truncated in the CLI output: Mode: Client Channel: 1 (58.320 GH) Fix that by allocating a large enough buffer. Signed-off-by: Daniel Golle --- diff --git a/iwinfo_cli.c b/iwinfo_cli.c index 35cc380..c052d63 100644 --- a/iwinfo_cli.c +++ b/iwinfo_cli.c @@ -58,7 +58,7 @@ static char * format_channel(int ch) static char * format_frequency(int freq) { - static char buf[10]; + static char buf[11]; if (freq <= 0) snprintf(buf, sizeof(buf), "unknown");