wilc1000: use strlcpy to avoid 'stringop-truncation' warning
Make use 'strlcpy' instead of 'strncpy' to overcome 'stringop-truncation' compiler warning. Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20200710051826.3267-3-ajay.kathat@microchip.com
This commit is contained in:
parent
4f5479e2ee
commit
1b3dd77430
|
@ -229,8 +229,7 @@ struct net_device *wilc_wfi_init_mon_interface(struct wilc *wl,
|
|||
return NULL;
|
||||
|
||||
wl->monitor_dev->type = ARPHRD_IEEE80211_RADIOTAP;
|
||||
strncpy(wl->monitor_dev->name, name, IFNAMSIZ);
|
||||
wl->monitor_dev->name[IFNAMSIZ - 1] = 0;
|
||||
strlcpy(wl->monitor_dev->name, name, IFNAMSIZ);
|
||||
wl->monitor_dev->netdev_ops = &wilc_wfi_netdev_ops;
|
||||
wl->monitor_dev->needs_free_netdev = true;
|
||||
|
||||
|
|
Loading…
Reference in New Issue