1STRNLEN(3) Linux Programmer's Manual STRNLEN(3)
2
3
4
6 strnlen - determine the length of a fixed-size string
7
9 #define _GNU_SOURCE
10
11 #include <string.h>
12
13 size_t strnlen(const char *s, size_t maxlen);
14
16 The strnlen() function returns the number of characters in the string
17 pointed to by s, not including the terminating '\0' character, but at
18 most maxlen. In doing this, strnlen() looks only at the first maxlen
19 characters at s and never beyond s+maxlen.
20
22 The strnlen() function returns strlen(s), if that is less than maxlen,
23 or maxlen if there is no '\0' character among the first maxlen characā
24 ters pointed to by s.
25
27 This function is a GNU extension.
28
30 strlen(3), feature_test_macros(7)
31
33 This page is part of release 3.22 of the Linux man-pages project. A
34 description of the project, and information about reporting bugs, can
35 be found at http://www.kernel.org/doc/man-pages/.
36
37
38
39GNU 1999-07-25 STRNLEN(3)