[PATCH 2/2] man/man3/wcrtomb.3: Document MB_CUR_MAX length requirement
Kang-Che Sung
explorer09@gmail.com
Sun Mar 16 09:08:39 GMT 2025
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>
---
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
More information about the Libc-alpha
mailing list