Sign in
cobalt
/
cobalt
/
5864f47b864e8bb7b417f15981009ad93bdff2ac
/
.
/
third_party
/
musl
/
src
/
string
/
strnlen.c
blob: 6442eb793fbeeda51a3f19b9e1c1269a030444e9 [
file
] [
log
] [
blame
]
#include
<string.h>
size_t
strnlen
(
const
char
*
s
,
size_t
n
)
{
const
char
*
p
=
memchr
(
s
,
0
,
n
);
return
p
?
p
-
s
:
n
;
}