summaryrefslogtreecommitdiff
path: root/apps/plugins/mikmod/strstr.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/mikmod/strstr.c')
-rw-r--r--apps/plugins/mikmod/strstr.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/apps/plugins/mikmod/strstr.c b/apps/plugins/mikmod/strstr.c
new file mode 100644
index 0000000000..c2cf97ecde
--- /dev/null
+++ b/apps/plugins/mikmod/strstr.c
@@ -0,0 +1,21 @@
1#ifdef HAVE_CONFIG_H
2#include "config.h"
3#endif
4
5#include <string.h>
6
7#include "mikmod_supp.h"
8
9char *strstr(const char *haystack, const char *needle)
10{
11 const char *scan;
12 size_t len;
13 char firstc;
14
15 firstc = *needle;
16 len = strlen(needle);
17 for (scan = haystack; *scan != firstc || strncmp(scan, needle, len); )
18 if (!*scan++)
19 return NULL;
20 return (char *)scan;
21}