mirror of
https://github.com/raphnet/gc_n64_usb-v3
synced 2024-11-15 13:45:02 -05: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;
|
||
|
}
|