ft_memset.c 1.0 KB

1234567891011121314151617181920212223242526
  1. /* ************************************************************************** */
  2. /* */
  3. /* ::: :::::::: */
  4. /* ft_memset.c :+: :+: :+: */
  5. /* +:+ +:+ +:+ */
  6. /* By: mazimi <mazimi@student.42.fr> +#+ +:+ +#+ */
  7. /* +#+#+#+#+#+ +#+ */
  8. /* Created: 2014/11/03 15:24:07 by mazimi #+# #+# */
  9. /* Updated: 2014/12/02 15:56:51 by mazimi ### ########.fr */
  10. /* */
  11. /* ************************************************************************** */
  12. #include "../libft.h"
  13. void *ft_memset(void *b, int c, size_t len)
  14. {
  15. size_t i;
  16. char *e;
  17. e = b;
  18. i = -1;
  19. while (++i < len)
  20. e[i] = (unsigned char)c;
  21. b = e;
  22. return (b);
  23. }