net: fix compiler warning

sixlowpan_assocresp.c: In function ‘sixlowpan_assoc_resp’:
sixlowpan_assocresp.c:48:3: warning: ‘strncpy’ specified bound 16 equals destination size [-Wstringop-truncation]
   48 |   strncpy(arg.ifr_name, ifname, IFNAMSIZ);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
chao an
2023-02-07 19:33:52 +08:00
committed by Xiang Xiao
parent f102f6f405
commit 8ad4ae5508
28 changed files with 182 additions and 130 deletions

View File

@@ -786,7 +786,7 @@ static int netinit_monitor(void)
/* Configure to receive a signal on changes in link status */
memset(&ifr, 0, sizeof(struct ifreq));
strncpy(ifr.ifr_name, NET_DEVNAME, IFNAMSIZ);
strlcpy(ifr.ifr_name, NET_DEVNAME, IFNAMSIZ);
ifr.ifr_mii_notify_event.sigev_notify = SIGEV_SIGNAL;
ifr.ifr_mii_notify_event.sigev_signo = CONFIG_NETINIT_SIGNO;