Browse Source

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>
Daniel Golle 3 years ago
parent
commit
74d13fb987
1 changed files with 1 additions and 1 deletions
  1. 1 1
      iwinfo_cli.c

+ 1 - 1
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");