From 930570b3b90ae956b1a58ff8e9fefa1fbdcfd304 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Thu, 15 Oct 2020 10:53:33 +0200 Subject: Fixing ft_strtolower --- src/str/ft_strtolower.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/str') diff --git a/src/str/ft_strtolower.c b/src/str/ft_strtolower.c index 2eb34c2..69efe21 100644 --- a/src/str/ft_strtolower.c +++ b/src/str/ft_strtolower.c @@ -6,7 +6,7 @@ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/02/10 04:10:01 by cacharle #+# #+# */ -/* Updated: 2020/02/10 04:12:21 by cacharle ### ########.fr */ +/* Updated: 2020/10/15 08:54:49 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -15,12 +15,15 @@ char *ft_strtolower(char *s) { - int i; + size_t i; if (s == NULL) return (NULL); - i = -1; - while (s[i]) + i = 0; + while (s[i] != '\0') + { s[i] = ft_tolower(s[i]); + i++; + } return (s); } -- cgit