aboutsummaryrefslogtreecommitdiff
path: root/src/str/ft_strtolower.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/str/ft_strtolower.c')
-rw-r--r--src/str/ft_strtolower.c11
1 files changed, 7 insertions, 4 deletions
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 <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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);
}