diff --git a/ft_strnstr.c b/ft_strnstr.c index d88f800..f598c51 100644 --- a/ft_strnstr.c +++ b/ft_strnstr.c @@ -6,7 +6,7 @@ /* By: tmaze +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2018/04/05 11:35:03 by tmaze #+# #+# */ -/* Updated: 2018/04/05 11:47:18 by tmaze ### ########.fr */ +/* Updated: 2018/04/08 15:28:28 by tmaze ### ########.fr */ /* */ /* ************************************************************************** */ @@ -20,6 +20,8 @@ char *ft_strnstr(const char *haystack, const char *needle, size_t len) i = -1; tmp = (char*)haystack; + if (ft_strequ(needle, "")) + return (tmp); while ((++i == 0 || tmp[i - 1]) && i < (int)len) if (tmp[i] == needle[0] && (j = 1)) {