Re: generic strncpy - off-by-one error

Alan Cox
2003-08-12T17:18:24Z

On Maw, 2003-08-12 at 02:56, Anthony Truong wrote:
> Thanks for pointing that out to me. However, I don't think the kernel
> strncpy implementation is exactly the same as that of Standard C lib

It is true it doesnt need to be

> implementation. Iwas just looking at it from the kernel code context.
> There's a point in doing it the "kernel" way, to save precious CPU
> cycles from being wasted otherwise.

CPU cycles, got lots of those 8). If its going to do anything it might
be to reference an extra cache line. For people who dont need padding
2.6 has strlcpy. Lots of drivers assume strncpy fills the entire block