infcubes crashes
[dosdemo] / libs / mikmod / posix / strstr.c
1 #ifdef HAVE_CONFIG_H
2 #include "config.h"
3 #endif
4
5 #include <string.h>
6
7 char *strstr(const char *haystack, const char *needle)
8 {
9         const char *scan;
10         size_t len;
11         char firstc;
12
13         firstc = *needle;
14         len = strlen(needle);
15         for (scan = haystack; *scan != firstc || strncmp(scan, needle, len); )
16                 if (!*scan++)
17                         return NULL;
18         return (char *)scan;
19 }