The "must" wording on the MB_CUR_MAX length requirement could be too strict for what the standard allows to the "s" buffer length. If the programmer knows the wide character to convert beforehand, they can allocate the buffer whose size "just fits" for the sequence. Signed-off-by: Kang-Che Sung <explorer09@xxxxxxxxx> --- man/man3/wctomb.3 | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/man/man3/wctomb.3 b/man/man3/wctomb.3 index fce54cb4b..f6aefcd0d 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 can be written at +.IR s . +The programmer must ensure that there is enough room to store the +multibyte sequence at .IR s . .P If @@ -68,6 +70,9 @@ function returns the number of bytes that 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