This is the mail archive of the
mailing list for the glibc project.
Re: [open-source] Re: Wish for 2002
> Date: Mon, 07 Jan 2002 11:01:00 -0500
> From: David Wheeler <firstname.lastname@example.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. :-)