瀏覽代碼

strlcpy is smart enough

strlcpy already accounts for the trailing zero in its length
computation, so there is no need to substract one to the buffer size.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Jan-Bernd Themann <themann@de.ibm.com>
Cc: Thomas Klein <osstklei@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Jean Delvare 18 年之前
父節點
當前提交
4eccccb362
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      drivers/net/ehea/ehea_ethtool.c

+ 2 - 2
drivers/net/ehea/ehea_ethtool.c

@@ -144,8 +144,8 @@ static int ehea_nway_reset(struct net_device *dev)
 static void ehea_get_drvinfo(struct net_device *dev,
 static void ehea_get_drvinfo(struct net_device *dev,
 			       struct ethtool_drvinfo *info)
 			       struct ethtool_drvinfo *info)
 {
 {
-	strlcpy(info->driver, DRV_NAME, sizeof(info->driver) - 1);
-	strlcpy(info->version, DRV_VERSION, sizeof(info->version) - 1);
+	strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
+	strlcpy(info->version, DRV_VERSION, sizeof(info->version));
 }
 }
 
 
 static u32 ehea_get_msglevel(struct net_device *dev)
 static u32 ehea_get_msglevel(struct net_device *dev)