net:fix coverity warning

Signed-off-by: hejianliang3 <hejianliang3@xiaomi.com>
This commit is contained in:
hejianliang3
2022-04-01 15:03:47 +08:00
committed by Petro Karashchenko
parent 451c53daa4
commit e9648d8a73
8 changed files with 11 additions and 17 deletions
+1 -1
View File
@@ -399,7 +399,7 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype)
*/
dev->d_ifname[IFNAMSIZ - 1] = '\0';
strncpy(devfmt_str, dev->d_ifname, IFNAMSIZ);
strlcpy(devfmt_str, dev->d_ifname, IFNAMSIZ);
/* Then use the content of the temporary buffer as the format
* string.