diff --git a/netutils/dhcpd/dhcpd.c b/netutils/dhcpd/dhcpd.c index 31e26904f..244e6eabf 100644 --- a/netutils/dhcpd/dhcpd.c +++ b/netutils/dhcpd/dhcpd.c @@ -1422,7 +1422,7 @@ static inline int dhcpd_openlistener(FAR const char *interface) /* Get the IP address of the selected device */ - strncpy(req.ifr_name, interface, IFNAMSIZ); + strlcpy(req.ifr_name, interface, IFNAMSIZ); ret = ioctl(sockfd, SIOCGIFADDR, (unsigned long)&req); if (ret < 0) {