Adding strlcpy and strlcat replacements to libradius

Nicolas Baradakis nbk at
Tue Sep 20 02:29:22 CEST 2005

I think we may perhaps add an autoconf test to detect whether the
system provides the srtlcpy and strlcat functions from OpenBSD.
If they're not present, we'd compile a replacement in libradius.

These functions provide a consistent, unambiguous API described in
this paper:

I know that our home-made strNcpy already ensures NUL-terminaison,
but it has some weakness:
- it seems it's wrong when N <= 0
- it's not easy to check if truncation has occurred

I don't plan to change the code everywhere, but I'd like to have the
functions available when writing new code.

If I get approbation, I suggest to bring the following files in
libradius. As to my understanding their licence allows us to do that:

Nicolas Baradakis

More information about the Freeradius-Devel mailing list