From ad33f31d00cdf5593baa83b63eb5445ef2951250 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Sun, 2 Aug 2020 14:19:07 +0200 Subject: Added ft_memdup, Fixing ft_strtoupper --- src/str/ft_strtoupper.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/str/ft_strtoupper.c') diff --git a/src/str/ft_strtoupper.c b/src/str/ft_strtoupper.c index 4a751d3..5dcfac6 100644 --- a/src/str/ft_strtoupper.c +++ b/src/str/ft_strtoupper.c @@ -6,21 +6,23 @@ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/02/10 04:12:04 by cacharle #+# #+# */ -/* Updated: 2020/02/14 02:49:35 by cacharle ### ########.fr */ +/* Updated: 2020/08/02 14:14:17 by charles ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft_str.h" -#include "libft_ctype.h" char *ft_strtoupper(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_toupper(s[i]); + i++; + } return (s); } -- cgit