This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Using strlcpy if target OS allows it
On Mon, Apr 18, 2005 at 01:53:52PM -0700, Joe Buck wrote:
> Clearly a local patch to use strlcpy instead of strcpy in the testsuite
> doesn't hurt performance of the installed library, and other uses of
> strcpy in the include headers are all equivalent to strdup: allocate
> strlen()+1 elements and copy to it. Is strdup a blessed routine on
> OpenBSD? If so, you could use it (and avoid my objection to strlcpy:
> for every use of strcpy the buffer is exactly the right size, so using
> strlcpy to check for overflow is wasteful).
Nope. It's a C++ FAQ, you can't use strdup.