diff --git a/ft_strstr.c b/ft_strstr.c index f675e23..a8ffd60 100644 --- a/ft_strstr.c +++ b/ft_strstr.c @@ -6,7 +6,7 @@ /* By: tmaze +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2018/04/05 10:54:41 by tmaze #+# #+# */ -/* Updated: 2018/04/05 11:19:02 by tmaze ### ########.fr */ +/* Updated: 2018/04/08 15:25:55 by tmaze ### ########.fr */ /* */ /* ************************************************************************** */ @@ -20,6 +20,8 @@ char *ft_strstr(const char *haystack, const char *needle) i = -1; tmp = (char*)haystack; + if (ft_strequ(needle, "")) + return (tmp); while (++i == 0 || tmp[i - 1]) if (tmp[i] == needle[0] && (j = 1)) {