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 <xypron.glpk@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2020-11-28 10:00:23 +01:00
parent e115d825c3
commit 45323bbef7
1 changed files with 1 additions and 1 deletions

View File

@ -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 ()