wireless-tools: fix iwconfig show 32b ssid

This commit is contained in:
hanwckf 2024-10-14 00:14:28 +08:00
parent 2d70f7e688
commit 102aabe65f

View File

@ -0,0 +1,19 @@
diff --git a/iwlib.c b/iwlib.c
index 0afa8c1e..0a9d7259 100644
--- a/iwlib.c
+++ b/iwlib.c
@@ -707,12 +707,13 @@ iw_get_basic_config(int skfd,
/* Get ESSID */
wrq.u.essid.pointer = (caddr_t) info->essid;
- wrq.u.essid.length = IW_ESSID_MAX_SIZE + 1;
+ wrq.u.essid.length = IW_ESSID_MAX_SIZE;
wrq.u.essid.flags = 0;
if(iw_get_ext(skfd, ifname, SIOCGIWESSID, &wrq) >= 0)
{
info->has_essid = 1;
info->essid_on = wrq.u.data.flags;
+ info->essid[IW_ESSID_MAX_SIZE] = '\0';
}
/* Get operation mode */