strnlen.3: never beyond s+maxlen

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Michael,

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]"

Best regards

Heinrich





[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux