From 871545305c0e16f043d5b3da801d5c64d5c69edc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?tanguy=20maz=C3=A9?= Date: Sat, 7 Apr 2018 00:39:55 +0200 Subject: [PATCH] ft_strclr --- Makefile | 7 ++++--- ft_strclr.c | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 ft_strclr.c diff --git a/Makefile b/Makefile index 2bbbf99..3e0e64d 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ # By: tmaze +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2018/04/04 10:51:59 by tmaze #+# #+# # -# Updated: 2018/04/06 19:04:49 by tmaze ### ########.fr # +# Updated: 2018/04/07 00:38:15 by tmaze ### ########.fr # # # #******************************************************************************# @@ -48,7 +48,8 @@ SRCS = \ ft_memalloc.c \ ft_memdel.c \ ft_strnew.c \ - ft_strdel.c + ft_strdel.c \ + ft_strclr.c OBJS = $(SRCS:.c=.o) INCLS = -I. @@ -68,4 +69,4 @@ clean: fclean: clean rm -f $(NAME) -re: fclean all \ No newline at end of file +re: fclean all diff --git a/ft_strclr.c b/ft_strclr.c new file mode 100644 index 0000000..6209a1f --- /dev/null +++ b/ft_strclr.c @@ -0,0 +1,22 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_strclr.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: tmaze +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2018/04/06 23:27:33 by tmaze #+# #+# */ +/* Updated: 2018/04/06 23:34:44 by tmaze ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +void strclr(char *s) +{ + int i; + + i = 0; + while (s[i]) + s[i++] = '\0'; +}