mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-20 04:26:04 +08:00
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:
@@ -165,7 +165,7 @@ static int _netlib_ipv4adaptor(in_addr_t destipaddr,
|
||||
|
||||
/* Get the network mask */
|
||||
|
||||
strncpy(maskreq.ifr_name, ifr->ifr_name, IFNAMSIZ);
|
||||
strlcpy(maskreq.ifr_name, ifr->ifr_name, IFNAMSIZ);
|
||||
|
||||
ret = ioctl(sd, SIOCGIFNETMASK, (unsigned long)((uintptr_t)&maskreq));
|
||||
if (ret < 0)
|
||||
|
Reference in New Issue
Block a user