This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]