strlcpy()
Posted May 29, 2003 19:54 UTC (Thu) by
dwheeler (guest, #1216)
In reply to:
strlcpy() by cpeterso
Parent article:
strlcpy()
Yes, strlcpy() is in the *BSDs, it's also in Sun Solaris.
It's also in the library Glib (NOT glibc), the basic library for
GTK+ and GNOME.
However, it is NOT in glibc, because Ulrich Drepper doesn't want it
in there. You can see his rationale for this in the glibc
mailing list.
I don't agree with his decision.
One of the biggest security problems is STILL buffer overflows, and
strlcpy()/strlcat() can really help reduce their incidence.
And since it's not in glibc, everyone has to "roll their own"
implementation (which may not be as efficient as it would be if
it were in the standard library).
If a future C standard included strlcpy() in the standard C library,
then I believe glibc would add it too.
Thus, if you want strlcpy() available everywhere,
it might be best to appear to the ISO C group to add strlcpy()
and strlcat() to the C standard library.
(
Log in to post comments)