mirror of
https://github.com/raphnet/gc_n64_usb-v3
synced 2024-10-31 15:45:09 -04:00
16 lines
301 B
C
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;
|
|
}
|