Re: [PATCH] arch/* strlcpy conversion

Oleg Drokin (green@namesys.com)
Tue, 27 May 2003 17:27:27 +0400


Hello!

On Sun, May 25, 2003 at 10:38:50PM -0400, Ben Collins wrote:

> Index: linux-2.5/arch/um/os-Linux/drivers/tuntap_user.c
> ===================================================================
> --- linux-2.5/arch/um/os-Linux/drivers/tuntap_user.c (revision 10155)
> +++ linux-2.5/arch/um/os-Linux/drivers/tuntap_user.c (working copy)
> @@ -143,7 +143,7 @@
> }
> memset(&ifr, 0, sizeof(ifr));
> ifr.ifr_flags = IFF_TAP;
> - strncpy(ifr.ifr_name, pri->dev_name, sizeof(ifr.ifr_name) - 1);
> + strlcpy(ifr.ifr_name, pri->dev_name, sizeof(ifr.ifr_name));
> if(ioctl(pri->fd, TUNSETIFF, (void *) &ifr) < 0){
> printk("TUNSETIFF failed, errno = %d", errno);
> close(pri->fd);

This part is bogus.
the smth_user.c files in arch/um are files that are compiled against userspace headers,
there is no way tuntap_user.c can know anything about strlcpy().
Or at least the strlcpy() forward declaration should be added to avoid a warning.

Bye,
Oleg
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/