Embedded Artistry Framework
Embedded Systems C++ Framework
Functions
memmem.c File Reference
#include <string.h>
Include dependency graph for memmem.c:

Functions

void * memmem (const void *l, size_t l_len, const void *s, size_t s_len)
 Find substring s in memory area l. More...
 

Function Documentation

◆ memmem()

void* memmem ( const void *  l,
size_t  l_len,
const void *  s,
size_t  s_len 
)

Find substring s in memory area l.

Finds the start of the first occurrence of the substring s of length s_len in the memory area l of length l_len.

The behavior is undefined if access occurs beyond the end of the array (s) searched. The behavior is undefined if s is a null pointer.

Parameters
lpointer to the object to be examined
l_lennumber of characters to examine
sthe substring to search for
s_lennumber of characters to examine
Returns
a pointer to the beginning of the substring, or NULL if the substring is not found.

References memchr(), memcmp(), NULL, and s.