strcpy_s, strlcpy, and strncpy and checking for overflow

Mike Frysinger vapier@gentoo.org
Sat May 5 08:16:00 GMT 2007


On Saturday 05 May 2007, Yuhong Bao wrote:
> strncpy makes it hard to check for overflow.
> strlcpy make it much easier to check for overflow.
> strcpy_s (part of the VC2005 libraries) do not copy the string at all if
> overflow has happened. You must use strncpy_s with _TRUNCATE specified in
> the count parameter to truncate.

were you trying to ask a question ?  seems like you were just stating some 
facts ...
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 827 bytes
Desc: This is a digitally signed message part.
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20070505/9d94d7c0/attachment.sig>


More information about the Libc-alpha mailing list