Commit 1b3dd774 authored by Ajay Singh's avatar Ajay Singh Committed by Kalle Valo

wilc1000: use strlcpy to avoid 'stringop-truncation' warning

Make use 'strlcpy' instead of 'strncpy' to overcome 'stringop-truncation'
compiler warning.
Reported-by: default avatarkernel test robot <lkp@intel.com>
Signed-off-by: default avatarAjay Singh <ajay.kathat@microchip.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200710051826.3267-3-ajay.kathat@microchip.com
parent 4f5479e2
...@@ -229,8 +229,7 @@ struct net_device *wilc_wfi_init_mon_interface(struct wilc *wl, ...@@ -229,8 +229,7 @@ struct net_device *wilc_wfi_init_mon_interface(struct wilc *wl,
return NULL; return NULL;
wl->monitor_dev->type = ARPHRD_IEEE80211_RADIOTAP; wl->monitor_dev->type = ARPHRD_IEEE80211_RADIOTAP;
strncpy(wl->monitor_dev->name, name, IFNAMSIZ); strlcpy(wl->monitor_dev->name, name, IFNAMSIZ);
wl->monitor_dev->name[IFNAMSIZ - 1] = 0;
wl->monitor_dev->netdev_ops = &wilc_wfi_netdev_ops; wl->monitor_dev->netdev_ops = &wilc_wfi_netdev_ops;
wl->monitor_dev->needs_free_netdev = true; wl->monitor_dev->needs_free_netdev = true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment