1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- #include <string.h>
- char *
- strstr(const char *s, const char *find)
- {
- char c, sc;
- size_t len;
- if ((c = *find++) != 0) {
- len = strlen(find);
- do {
- do {
- if ((sc = *s++) == 0)
- return (NULL);
- } while (sc != c);
- } while (strncmp(s, find, len) != 0);
- s--;
- }
- return ((char *)s);
- }
|