From 607717efc45bb4d3d0a604fbbf79cc6a73d72986 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kha=C3=AFs=20COLIN?= Date: Wed, 23 Oct 2024 12:26:44 +0200 Subject: [PATCH] fix(ft_split): remame strnchr to strnotchr to be more clear --- ft_split.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ft_split.c b/ft_split.c index fd65651..1b30614 100644 --- a/ft_split.c +++ b/ft_split.c @@ -6,7 +6,7 @@ /* By: kcolin +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/10/17 16:09:01 by kcolin #+# #+# */ -/* Updated: 2024/10/17 16:50:01 by kcolin ### ########.fr */ +/* Updated: 2024/10/23 12:20:51 by kcolin ### ########.fr */ /* */ /* ************************************************************************** */ @@ -29,7 +29,7 @@ static size_t count_segments(char const *s, char c) return (count); } -static char *ft_strnchr(const char *s, int c) +static char *ft_strnotchr(const char *s, int c) { int i; @@ -70,7 +70,7 @@ char **ft_split(char const *s, char c) out_idx = 0; while (out_idx < count_segments(s, c)) { - s_idx = ft_strnchr(s + s_idx, c) - s; + s_idx = ft_strnotchr(s + s_idx, c) - s; length = ft_strchr(s + s_idx, c) - s - s_idx; out[out_idx] = ft_substr(s, s_idx, length); if (out[out_idx] == NULL)