summaryrefslogtreecommitdiff
path: root/drivers/net/usb/r8152.c
diff options
context:
space:
mode:
authorhayeswang <hayeswang@realtek.com>2014-08-26 06:08:23 +0400
committerDavid S. Miller <davem@davemloft.net>2014-08-28 03:18:06 +0400
commitb0b46c7766e6803df7f76cddbbc0172092b5fa7c (patch)
treeb094cc643a31a3d99ca90d8daf58aa4abd9aaf25 /drivers/net/usb/r8152.c
parent5c21403d74af2c9cd635a34c2f9199681a5b813e (diff)
downloadlinux-b0b46c7766e6803df7f76cddbbc0172092b5fa7c.tar.xz
r8152: replace strncpy with strlcpy
Replace the strncpy with strlcpy, and use sizeof to determine the length. Signed-off-by: Hayes Wang <hayeswang@realtek.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb/r8152.c')
-rw-r--r--drivers/net/usb/r8152.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 2470d9c2e4f4..33dcc975c62d 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -3151,8 +3151,8 @@ static void rtl8152_get_drvinfo(struct net_device *netdev,
{
struct r8152 *tp = netdev_priv(netdev);
- strncpy(info->driver, MODULENAME, ETHTOOL_BUSINFO_LEN);
- strncpy(info->version, DRIVER_VERSION, ETHTOOL_BUSINFO_LEN);
+ strlcpy(info->driver, MODULENAME, sizeof(info->driver));
+ strlcpy(info->version, DRIVER_VERSION, sizeof(info->version));
usb_make_path(tp->udev, info->bus_info, sizeof(info->bus_info));
}