From: Michael Kerrisk Date: Sat, 28 Nov 2020 09:00:23 +0000 (+0100) Subject: strnlen.3: Fix a small inconsistency in the text X-Git-Tag: man-pages-5.10~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=45323bbef7fb06eec3fa210ee6c1651bbc57c38d;p=thirdparty%2Fman-pages.git strnlen.3: Fix a small inconsistency in the text Quoting Heinrich: The strnlen.3 manpage has the following sentence: "In doing this, strnlen() looks only at the first maxlen characters in the string pointed to by s and never beyond s+maxlen." This sentence is self-contradictory: The last visited character implied by "first maxlen characters" is s[maxlen-1]. Given that "beyond a" does not include "a", the last visited character implied by "never beyond s+maxlen" is s[maxlen]. A consistent sentence would be "In doing this, strnlen() looks only at the first maxlen characters in the string pointed to by s and never beyond s+maxlen-1." I would prefer "In doing this, strnlen() looks only at the first maxlen characters in the string pointed to by s and never beyond s[maxlen-1]" Reported-by: Heinrich Schuchardt Signed-off-by: Michael Kerrisk --- diff --git a/man3/strnlen.3 b/man3/strnlen.3 index 6c4b080fcd..d4385af496 100644 --- a/man3/strnlen.3 +++ b/man3/strnlen.3 @@ -54,7 +54,7 @@ looks only at the first characters in the string pointed to by .I s and never beyond -.IR s+maxlen . +.IR s[maxlen\-1] . .SH RETURN VALUE The .BR strnlen ()