From 507661351ca718c8a3d8213a0a80f994825fc881 Mon Sep 17 00:00:00 2001 From: Rudy Bousset Date: Tue, 29 Oct 2019 12:25:57 +0100 Subject: libft included --- libft/ft_memset.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 libft/ft_memset.c (limited to 'libft/ft_memset.c') diff --git a/libft/ft_memset.c b/libft/ft_memset.c new file mode 100644 index 0000000..b94c6fa --- /dev/null +++ b/libft/ft_memset.c @@ -0,0 +1,33 @@ +/* ************************************************************************** */ +/* LE - / */ +/* / */ +/* ft_memset.c .:: .:/ . .:: */ +/* +:+:+ +: +: +:+:+ */ +/* By: rbousset +:+ +: +: +:+ */ +/* #+# #+ #+ #+# */ +/* Created: 2019/10/08 13:41:09 by rbousset #+# ## ## #+# */ +/* Updated: 2019/10/13 08:38:10 by rbousset ### #+. /#+ ###.fr */ +/* / */ +/* / */ +/* ************************************************************************** */ + +#include + +void + *ft_memset(void *b, int c, size_t len) +{ + unsigned char *str; + + str = b; + if (!b) + return (NULL); + if (!len) + return (b); + while (len > 0) + { + *str = (unsigned char)c; + str++; + len--; + } + return (b); +} -- cgit v1.2.3