xtensa: strlcpy is smart enough
authorJean Delvare <khali@linux-fr.org>
Sun, 6 May 2007 21:51:54 +0000 (14:51 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 7 May 2007 19:13:04 +0000 (12:13 -0700)
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: Chris Zankel <chris@zankel.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/xtensa/platform-iss/network.c

index ab05bff40104c80ac2849131b57213a9aa898b5a..4bfe333be22943558a8448679b71f4bcd2b273e8 100644 (file)
@@ -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 "