mirror of
https://github.com/kbeckmann/game-and-watch-retro-go.git
synced 2025-12-17 19:16:02 +01:00
20 lines
344 B
C
20 lines
344 B
C
#ifdef HAVE_CONFIG_H
|
|
#include "config.h"
|
|
#endif
|
|
|
|
#include <string.h>
|
|
|
|
char *strstr(const char *haystack, const char *needle)
|
|
{
|
|
const char *scan;
|
|
size_t len;
|
|
char firstc;
|
|
|
|
firstc = *needle;
|
|
len = strlen(needle);
|
|
for (scan = haystack; *scan != firstc || strncmp(scan, needle, len); )
|
|
if (!*scan++)
|
|
return NULL;
|
|
return (char *)scan;
|
|
}
|