aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKang-Che Sung <explorer09@gmail.com>2025-03-17 02:32:13 +0800
committerAlejandro Colomar <alx@kernel.org>2025-03-20 23:14:45 +0100
commite921861a3d30cfc5f9263747a4e64a68e488288c (patch)
treeb77517d50cd4eecf5da631393dbb6cfa5489e0f5
parent24b307093047e1ffbfa053098ee5b9e435800e2c (diff)
downloadman-pages-e921861a3d30cfc5f9263747a4e64a68e488288c.tar.gz
man/man3/wc{,r}tomb.3: wfix regarding MB_CUR_MAX
Add the missing length requirement about MB_CUR_MAX to wcrtomb(3). Change the wording on the MB_CUR_MAX requirement in wctomb(3). If programmers know the wide character to convert beforehand, they are allowed to use a buffer smaller than MB_CUR_MAX bytes, as long as it "fits" the sequence. Signed-off-by: Kang-Che Sung <explorer09@gmail.com> Message-ID: <CADDzAfN7_kdv4iQtH=OpgSWtRuqOZXYhxsBiz_OF8Zqf-zy4_Q@mail.gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rw-r--r--man/man3/wcrtomb.38
-rw-r--r--man/man3/wctomb.38
2 files changed, 13 insertions, 3 deletions
diff --git a/man/man3/wcrtomb.3 b/man/man3/wcrtomb.3
index 967a1a0f66..162d97df88 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 will 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 ()
diff --git a/man/man3/wctomb.3 b/man/man3/wctomb.3
index fce54cb4b4..643e2e6778 100644
--- a/man/man3/wctomb.3
+++ b/man/man3/wctomb.3
@@ -42,10 +42,12 @@ that is, the number of
bytes written at
.IR s .
.P
-The programmer must ensure that there is
-room for at least
+At most
.B MB_CUR_MAX
-bytes at
+bytes will be written at
+.IR s .
+The programmer must ensure that there is enough room to store the
+multibyte sequence at
.IR s .
.P
If