X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/fbd86d4cc20b02a10edcca92fb7ae0a143e63cc4..1f2f436a38f7ae2d39a943ad2898d8fed4ed2e58:/string/FreeBSD/strlen.3 diff --git a/string/FreeBSD/strlen.3 b/string/FreeBSD/strlen.3 index b490ced..031f450 100644 --- a/string/FreeBSD/strlen.3 +++ b/string/FreeBSD/strlen.3 @@ -13,10 +13,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. @@ -34,13 +30,13 @@ .\" SUCH DAMAGE. .\" .\" @(#)strlen.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/string/strlen.3,v 1.6 2001/10/01 16:09:00 ru Exp $ +.\" $FreeBSD: src/lib/libc/string/strlen.3,v 1.9 2009/04/07 13:42:53 trasz Exp $ .\" -.Dd June 4, 1993 +.Dd February 28, 2009 .Dt STRLEN 3 .Os .Sh NAME -.Nm strlen +.Nm strlen, strnlen .Nd find length of string .Sh LIBRARY .Lb libc @@ -48,12 +44,22 @@ .In string.h .Ft size_t .Fn strlen "const char *s" +.Ft size_t +.Fn strnlen "const char *s" "size_t maxlen" .Sh DESCRIPTION The .Fn strlen function computes the length of the string .Fa s . +The +.Fn strnlen +function attempts to compute the length of +.Fa s , +but never scans beyond the first +.Fa maxlen +bytes of +.Fa s . .Sh RETURN VALUES The .Fn strlen @@ -63,11 +69,24 @@ the number of characters that precede the terminating .Dv NUL character. +The +.Fn strnlen +function returns either the same result as +.Fn strlen +or +.Fa maxlen , +whichever is smaller. .Sh SEE ALSO -.Xr string 3 +.Xr string 3 , +.Xr wcslen 3 , +.Xr wcswidth 3 .Sh STANDARDS The .Fn strlen function conforms to .St -isoC . +The +.Fn strnlen +function conforms to +.St -p1003.1-2008 .