1
0
mirror of https://github.com/raphnet/gc_n64_usb-v3 synced 2024-12-22 15:28:52 -05:00
gc_n64_usb-v3/tool/memmem.c
2015-10-24 15:04:38 -04:00

16 lines
301 B
C

#include <string.h>
void *memmem(const void *haystack, size_t haystack_len,
const void *needle, size_t needle_len)
{
int i;
if (needle_len > haystack_len)
return NULL;
for (i=0; i<haystack_len; i++) {
if (!memcmp(haystack +i, needle, needle_len))
return haystack + i;
}
return NULL;
}