Function ndpi_strnstr

Function Documentation

char *ndpi_strnstr(const char *haystack, const char *needle, size_t len)

Finds the first occurrence of the substring ‘needle’ in the string ‘haystack’.

This function is similar to the standard strstr() function, but it has an additional parameter len that specifies the maximum length of the search.

Return
Pointer to the first occurrence of ‘needle’ in ‘haystack’, or NULL if no match is found.
Parameters
  • haystack: The string to search in.
  • needle: The substring to search for.
  • len: The maximum length of the search.