From 10b4feb67c8af2b099dabd66f948b02e180bae0d Mon Sep 17 00:00:00 2001 From: Cabergs Charles Date: Mon, 7 Oct 2019 11:35:51 +0200 Subject: Normed everything Created a few dummy functions to resolve functions having more than 25 lines. --- ft_strnstr.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'ft_strnstr.c') diff --git a/ft_strnstr.c b/ft_strnstr.c index 4109f2d..5f4bb91 100644 --- a/ft_strnstr.c +++ b/ft_strnstr.c @@ -1,24 +1,34 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_strnstr.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cacharle +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/10/07 10:25:13 by cacharle #+# #+# */ +/* Updated: 2019/10/07 10:26:11 by cacharle ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include #include #include "libft.h" -#include -char *ft_strnstr(const char *big, const char *little, size_t len) +char *ft_strnstr(const char *big, const char *little, size_t len) { - size_t i; - size_t j; - size_t little_len; + size_t i; + size_t j; + size_t little_len; - little_len = ft_strlen(little); + little_len = ft_strlen(little); if (little_len == 0 || len == 0) return ((char*)big); - i = 0; + i = 0; while (i < len && big[i]) { j = 0; while (i + j < len && little[j] && big[i + j]) { - /* printf(" %lu", i + j); */ if (little[j] != big[i + j]) break ; j++; -- cgit