Re: [PATCH 2.6]: IPv6: strcpy -> strlcpy

From: Jörn Engel
Date: Fri Nov 28 2003 - 06:24:52 EST


On Fri, 28 November 2003 09:40:22 +0900, YOSHIFUJI Hideaki / ?$B5HF#1QL@ wrote:
> In article <20031128.092642.47232575.yoshfuji@xxxxxxxxxxxxxx> (at Fri, 28 Nov 2003 09:26:42 +0900 (JST)), YOSHIFUJI Hideaki / ?$B5HF#1QL@ <yoshfuji@xxxxxxxxxxxxxx> says:
>
> > > 3) if (len)
> > > strncpy(dst, src, len - 1);
> > > dst[len] = 0;
>
> grr, another mistake...:
>
> if (len) {
> strncpy(dst, src, len - 1);
> dst[len - 1];
^
> }

Did you forget ' = 0' there? ;)

Jörn

--
ticks = jiffies;
while (ticks == jiffies);
ticks = jiffies;
-- /usr/src/linux/init/main.c
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/