From a287db1124beda38507739f892c085bd3654ebd7 Mon Sep 17 00:00:00 2001 From: Rudy Bousset Date: Fri, 17 Jan 2020 19:34:53 +0100 Subject: Added libft --- libft/src/ft_memset.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 libft/src/ft_memset.c (limited to 'libft/src/ft_memset.c') diff --git a/libft/src/ft_memset.c b/libft/src/ft_memset.c new file mode 100644 index 0000000..1498ae6 --- /dev/null +++ b/libft/src/ft_memset.c @@ -0,0 +1,31 @@ +/* ************************************************************************** */ +/* 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 (!len) + return (b); + while (len > 0) + { + *str = (unsigned char)c; + str++; + len--; + } + return (b); +} -- cgit v1.2.3