ft_strnstr - kibotrel/42-Libft GitHub Wiki

char	*ft_strnstr(const char *haystack, const char *needle, size_t n)

Description :

Searchs the first occurrence of the string needle into the string haystack until n characters are checked in haystack.

Return Value :

Returns the string haystack starting from the first character of the first occurrence of needle. If string needle is empty, the whole string haystack is returned. Finally if needle is nowhere in haystack, NULL is returned.

Source code