From 5b653ccffdc33c8774697a93cad0b499b88dca71 Mon Sep 17 00:00:00 2001 From: Charles Date: Sun, 28 Jul 2019 21:12:28 +0200 Subject: std library function almost done, tested with libft-unit-tests --- ft_memset.c | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 ft_memset.c (limited to 'ft_memset.c') diff --git a/ft_memset.c b/ft_memset.c new file mode 100644 index 0000000..e09db6c --- /dev/null +++ b/ft_memset.c @@ -0,0 +1,11 @@ +#include + +void *ft_memset(void *s, int c, size_t n) +{ + unsigned char uchar_c; + + uchar_c = (unsigned char)c; + while (n-- > 0) + ((unsigned char*)s)[n] = uchar_c; + return (s); +} -- cgit