This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc 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: [open-source] Re: Wish for 2002


> Date: Mon, 07 Jan 2002 11:01:00 -0500
> From: David Wheeler <dwheeler@ida.org>
> 
> Generally, I prefer the dynamic length approaches, but sometimes I
> find they're inappropriate and strl* is a better approach.

But strlcat and strlcpy are never necessary, even for fixed-length buffers.
You can achieve the same effect with memcpy, or snprintf, or whatever.
In high-quality application code, strlcpy and strlcat are rarely if
ever superior to the standard alternatives.

strlcpy and strlcat are merely temporary stopgaps, useful for quick
hacks to poor-quality application code.  We should not overstate their
importance, nor should we promote their use in new application code.
(We may need to add them to glibc anyway, but let's not be under any
illusions about them.  :-)


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