[COMMITTED] Fix strnlen doc re array size
Paul Eggert
eggert@cs.ucla.edu
Wed Jun 26 15:56:48 GMT 2024
On 6/26/24 11:52, Vincent Lefevre wrote:
> This disagrees with the strnlen(3) man page from Linux man-pages 6.8,
> which requires s to be a string, i.e. null-terminated (though the
> null byte may be beyond the first maxlen bytes).
>
> However, it seems that POSIX does not have such a requirement.
>
> So, what's the actual status?
The actual status is that the Linux man page is wrong, and needs to be
fixed. The glibc code is supposed to conform to POSIX, and to the
recently-updated manual which is merely POSIX reworded. (I assume the
glibc code does conform but I have not checked this.)
If you read the thread I cited, this topic came up because Android got
it wrong a while back (fixed in Android 5.1).
More information about the Libc-alpha
mailing list