repo.or.cz
/
musl.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
fix mips setjmp/longjmp fpu state on r6, related issues
[musl.git]
/
src
/
string
/
strnlen.c
blob
6442eb793fbeeda51a3f19b9e1c1269a030444e9
1
#include <string.h>
2
3
size_t
strnlen
(
const char
*
s
,
size_t
n
)
4
{
5
const char
*
p
=
memchr
(
s
,
0
,
n
);
6
return
p
?
p
-
s
:
n
;
7
}