From 611f53a510743e74af9c694251c058e5b7507b6f Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 8 Apr 2023 13:54:37 -0700 Subject: [PATCH] manual: improve wcslcpy/wcslcat doc Mention OpenBSD versions, and mention the new functions elsewhere when appropriate. --- manual/maint.texi | 4 ++++ manual/string.texi | 13 +++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/manual/maint.texi b/manual/maint.texi index 3ad4647cf3..89da704f45 100644 --- a/manual/maint.texi +++ b/manual/maint.texi @@ -415,6 +415,10 @@ The following functions and macros are fortified in @theglibc{}: @item @code{wcscpy} +@item @code{wcslcat} + +@item @code{wcslcpy} + @item @code{wcsncat} @item @code{wcsncpy} diff --git a/manual/string.texi b/manual/string.texi index 781fba245a..d2c3b6c902 100644 --- a/manual/string.texi +++ b/manual/string.texi @@ -727,7 +727,8 @@ As noted below, this function has significant performance issues. @end deftypefun Programmers using the @code{strcat} or @code{wcscat} functions (or the -@code{strlcat}, @code{strncat} and @code{wcsncat} functions defined in +@code{strlcat}, @code{strncat}, @code{wcslcat} +and @code{wcsncat} functions defined in a later section, for that matter) can easily be recognized as lazy and reckless. In almost all situations the lengths of the participating strings are known (it better should be @@ -849,7 +850,7 @@ Whenever a programmer feels the need to use @code{strcat} she or he should think twice and look through the program to see whether the code cannot be rewritten to take advantage of already calculated results. The related functions @code{strlcat}, @code{strncat}, -@code{wcscat} and @code{wcsncat} +@code{wcscat}, @code{wcslcat} and @code{wcsncat} are almost always unnecessary, too. Again: it is almost always unnecessary to use functions like @code{strcat}. @@ -1121,10 +1122,10 @@ This function is derived from OpenBSD 2.4. @standards{BSD, string.h} @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} This function is a variant of @code{strlcpy} for wide strings. -The @var{size} argument counts the length of the destination buffer in +The @var{size} argument counts the length of the destination buffer in wide characters (and not bytes). -This function is derived from BSD. +This function is derived from OpenBSD 3.8. @end deftypefun @deftypefun size_t strlcat (char *restrict @var{to}, const char *restrict @var{from}, size_t @var{size}) @@ -1167,10 +1168,10 @@ This function is derived from OpenBSD 2.4. @standards{BSD, string.h} @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} This function is a variant of @code{strlcat} for wide strings. -The @var{size} argument counts the length of the destination buffer in +The @var{size} argument counts the length of the destination buffer in wide characters (and not bytes). -This function is derived from BSD. +This function is derived from OpenBSD 3.8. @end deftypefun Because these functions can abruptly truncate strings or wide strings, -- 2.39.2