diff --git a/Makefile b/Makefile index 166c9ba..96e3796 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ # By: kcolin +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2024/10/14 13:43:59 by kcolin #+# #+# # -# Updated: 2024/10/16 09:58:22 by kcolin ### ########.fr # +# Updated: 2024/10/16 10:30:28 by kcolin ### ########.fr # # # # **************************************************************************** # @@ -24,7 +24,8 @@ SOURCES = ft_isalpha.c \ ft_memmove.c \ ft_strlcpy.c \ ft_strlcat.c \ - ft_toupper.c + ft_toupper.c \ + ft_tolower.c OBJECTS = $(SOURCES:.c=.o) CC = gcc diff --git a/ft_tolower.c b/ft_tolower.c new file mode 100644 index 0000000..18122eb --- /dev/null +++ b/ft_tolower.c @@ -0,0 +1,36 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_tolower.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: kcolin +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2024/10/16 10:30:41 by kcolin #+# #+# */ +/* Updated: 2024/10/16 10:31:43 by kcolin ### ########.fr */ +/* */ +/* ************************************************************************** */ + +int ft_tolower(int c) +{ + if (c >= 'A' && c <= 'Z') + c += 0x20; + return (c); +} + +/* +#include +#include + +int main(void) +{ + int i; + + i = 0; + while (i < 256) + { + printf("%d\t%c\t%c\t%c\n", i, i, ft_tolower(i), tolower(i)); + i++; + } + return (0); +} +*/ diff --git a/libft.h b/libft.h index 48ca73c..fa3b5f4 100644 --- a/libft.h +++ b/libft.h @@ -31,5 +31,6 @@ t_size ft_strlcpy(char *dst, const char *src, t_size size); t_size ft_strlcat(char *dst, const char *src, t_size size); int ft_toupper(int c); +int ft_tolower(int c); #endif