[PATCH 2/2] man/man3/wcrtomb.3: Document MB_CUR_MAX length requirement
Alejandro Colomar
alx@kernel.org
Sun Mar 16 12:10:01 GMT 2025
Hi,
On Sun, Mar 16, 2025 at 05:08:39PM +0800, Kang-Che Sung wrote:
> The wcrtomb(3) function, like wctomb(3), has a length requirement about
> MB_CUR_MAX. So copy the wording about MB_CUR_MAX from wctomb(3) to
> wcrtomb(3).
>
> Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
Since this patch does the same exact thing as patch 1/2 but to a
different page, we can squash both patches into one.
Cheers,
Alex
> ---
> man/man3/wcrtomb.3 | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/man/man3/wcrtomb.3 b/man/man3/wcrtomb.3
> index 967a1a0f6..27b5bd9c1 100644
> --- a/man/man3/wcrtomb.3
> +++ b/man/man3/wcrtomb.3
> @@ -94,6 +94,14 @@ is NULL, a static anonymous
> state known only to the
> .BR wcrtomb ()
> function is used instead.
> +.P
> +At most
> +.B MB_CUR_MAX
> +bytes can be written at
> +.IR s .
> +The programmer must ensure that there is enough room to store the
> +multibyte sequence at
> +.IR s .
> .SH RETURN VALUE
> The
> .BR wcrtomb ()
> @@ -101,6 +109,9 @@ function returns the number of
> bytes that have been or would
> have been written to the byte array at
> .IR s .
> +The value returned will never be greater than the value of the
> +.B MB_CUR_MAX
> +macro.
> If
> .I wc
> can not be
> --
> 2.49.0
--
<https://www.alejandro-colomar.es/>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20250316/231e5b26/attachment.sig>
More information about the Libc-alpha
mailing list