From 6237703e77097be6f5e250e8a4fdea0e27ed54e0 Mon Sep 17 00:00:00 2001 From: kinou-p Date: Sun, 13 Dec 2020 22:57:38 +0100 Subject: [PATCH] push --- ft_strnstr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ft_strnstr.c b/ft_strnstr.c index 5ee5716..af1e057 100644 --- a/ft_strnstr.c +++ b/ft_strnstr.c @@ -6,7 +6,7 @@ /* By: apommier +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/11/29 00:13:42 by apommier #+# #+# */ -/* Updated: 2020/12/13 20:24:56 by apommier ### ########.fr */ +/* Updated: 2020/12/13 22:55:27 by apommier ### ########.fr */ /* */ /* ************************************************************************** */ @@ -18,11 +18,11 @@ char *ft_strnstr(const char *big, const char *little, size_t len) int j; i = 0; - if (!len || !little[i]) + if (!little[i]) return ((char*)big); if (!little[i]) return ((char*)big); - while (big[i] && len - i - 1) + while (big[i] && len - i) { j = 0; if (little[j] != big[i])