1
0
mirror of https://github.com/raphnet/gc_n64_usb-v3 synced 2024-11-15 05:35:00 -05:00
gc_n64_usb-v3/tool/memmem.c

16 lines
301 B
C
Raw Normal View History

2015-10-24 15:04:38 -04:00
#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;
}