Yuhong Bao
2007-05-05 06:57:01 UTC
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.
Yuhong Bao
_________________________________________________________________
Download Messenger. Join the im Initiative. Help make a difference today.
http://im.live.com/messenger/im/home/?source=TAGHM_APR07
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.
Yuhong Bao
_________________________________________________________________
Download Messenger. Join the im Initiative. Help make a difference today.
http://im.live.com/messenger/im/home/?source=TAGHM_APR07