repo.or.cz
/
Samba.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
s4-dsdb: Tests for security checks on undelete operation
[Samba.git]
/
lib
/
ccan
/
str
/
str.c
blob
fa9809fbd94d3670ac6190697f253f9c208b4342
1
#include <ccan/str/str.h>
2
3
size_t
strcount
(
const char
*
haystack
,
const char
*
needle
)
4
{
5
size_t
i
=
0
,
nlen
=
strlen
(
needle
);
6
7
while
((
haystack
=
strstr
(
haystack
,
needle
)) !=
NULL
) {
8
i
++;
9
haystack
+=
nlen
;
10
}
11
return
i
;
12
}