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
update sys/socket.h to linux v4.6
[musl.git]
/
src
/
string
/
wcscspn.c
blob
c4e52722e11d8d5cccb862a95a93dab2564dcc6a
1
#include <wchar.h>
2
3
size_t
wcscspn
(
const wchar_t
*
s
,
const wchar_t
*
c
)
4
{
5
const wchar_t
*
a
;
6
if
(!
c
[
0
])
return
wcslen
(
s
);
7
if
(!
c
[
1
])
return
(
s
=
wcschr
(
a
=
s
, *
c
)) ?
s
-
a
:
wcslen
(
a
);
8
for
(
a
=
s
; *
s
&& !
wcschr
(
c
, *
s
);
s
++);
9
return
s
-
a
;
10
}