Skip to content

Commit

Permalink
xtensa: strlcpy is smart enough
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Chris Zankel <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Jean Delvare authored and Linus Torvalds committed May 7, 2007
1 parent ee17b36 commit 0ddb16c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/xtensa/platform-iss/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand Down

0 comments on commit 0ddb16c

Please sign in to comment.