strlen.3, wcslen.3: Recommend alternatives where input buffer might not be null-terminated

Reported-by: Jonny Grant <jg@jguk.org>
Reported-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2021-08-08 04:16:15 +02:00
parent 21b8af1f3c
commit afaa08a481
2 changed files with 10 additions and 0 deletions

View File

@ -64,6 +64,11 @@ T} Thread safety MT-Safe
.hy
.ad
.sp 1
.SH NOTES
In cases where the input buffer may not contain
a terminating null byte,
.BR strnlen (3)
should be used instead.
.SH CONFORMING TO
POSIX.1-2001, POSIX.1-2008, C89, C99, C11, SVr4, 4.3BSD.
.SH SEE ALSO

View File

@ -56,6 +56,11 @@ T} Thread safety MT-Safe
.hy
.ad
.sp 1
.SH NOTES
In cases where the input buffer may not contain
a terminating null wide character,
.BR wcsnlen (3)
should be used instead.
.SH CONFORMING TO
POSIX.1-2001, POSIX.1-2008, C99.
.SH SEE ALSO