diff options
author | Daniel Golle <daniel@makrotopia.org> | 2021-01-05 15:09:40 +0000 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2021-01-05 22:19:43 +0000 |
commit | 74d13fb98730a7a8af6e6662d0f4281b6655ddd0 (patch) | |
tree | b4bbe7a41314a6a04cc4f57b5b450e6839848a77 /iwinfo_cli.c | |
parent | 4e22953eb171d432afd394af03423cee70ec8858 (diff) | |
download | iwinfo-74d13fb98730a7a8af6e6662d0f4281b6655ddd0.tar.gz |
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 <daniel@makrotopia.org>
Diffstat (limited to 'iwinfo_cli.c')
-rw-r--r-- | iwinfo_cli.c | 2 |
1 files changed, 1 insertions, 1 deletions
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"); |