Re: generic strncpy - off-by-one error

From: Anthony Truong
Date: Tue Aug 12 2003 - 11:49:14 EST


On Wed, 2003-08-13 at 00:24, Bernd Petrovitsch wrote:

>I don't see any problem with this code, and if we don't need to
>NULL-pad the dest string, we do not have to. It is not in the
>definition of strncpy().

Wrong: http://www.opengroup.org/onlinepubs/007908799/xsh/strncpy.html

Bernd

Hello,
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
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.

Regards,
Anthony Dominic Truong.



Disclaimer: The information contained in this transmission, including any
attachments, may contain confidential information of Matsushita Avionics
Systems Corporation. This transmission is intended only for the use of the
addressee(s) listed above. Unauthorized review, dissemination or other use
of the information contained in this transmission is strictly prohibited.
If you have received this transmission in error or have reason to believe
you are not authorized to receive it, please notify the sender by return
email and promptly delete the transmission.


-
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/