container_of: don't put member_ptr in container_off.
[ccan] / ccan / str / str.c
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 }