From: Jean Delvare Date: Sun, 6 May 2007 21:51:54 +0000 (-0700) Subject: xtensa: strlcpy is smart enough X-Git-Tag: upstream/snapshot3+hdmi~34669 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0ddb16cfb05c04d644b4ba8e36e780b15f47a191;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git xtensa: 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 Cc: Chris Zankel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/xtensa/platform-iss/network.c b/arch/xtensa/platform-iss/network.c index ab05bff..4bfe333 100644 --- a/arch/xtensa/platform-iss/network.c +++ b/arch/xtensa/platform-iss/network.c @@ -251,7 +251,7 @@ static int tuntap_open(struct iss_net_private *lp) memset(&ifr, 0, sizeof ifr); ifr.ifr_flags = IFF_TAP | IFF_NO_PI; - strlcpy(ifr.ifr_name, dev_name, sizeof ifr.ifr_name - 1); + strlcpy(ifr.ifr_name, dev_name, sizeof ifr.ifr_name); if ((err = simc_ioctl(fd, TUNSETIFF, (void*) &ifr)) < 0) { printk("Failed to set interface, returned %d "