From 454a20c8756c9c1d55419153255fc7692b3d2199 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Wed, 14 Jun 2023 18:10:08 +0200 Subject: Implement strlcpy and strlcat [BZ #178] These functions are about to be added to POSIX, under Austin Group issue 986. The fortified strlcat implementation does not raise SIGABRT if the destination buffer does not contain a null terminator, it just inherits the non-failing regular strlcat behavior. Reviewed-by: Siddhesh Poyarekar --- include/string.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/string.h b/include/string.h index 673cfd7272..0c78ad2539 100644 --- a/include/string.h +++ b/include/string.h @@ -88,6 +88,10 @@ libc_hidden_proto (__stpcpy) # define __stpcpy(dest, src) __builtin_stpcpy (dest, src) #endif libc_hidden_proto (__stpncpy) +extern __typeof (strlcpy) __strlcpy; +libc_hidden_proto (__strlcpy) +extern __typeof (strlcat) __strlcat; +libc_hidden_proto (__strlcat) libc_hidden_proto (__rawmemchr) libc_hidden_proto (__strcasecmp) libc_hidden_proto (__strcasecmp_l) -- cgit 1.4.1