minishell
ft_memset.c
Go to the documentation of this file.
1 /* ************************************************************************** */
2 /* */
3 /* ::: :::::::: */
4 /* ft_memset.c :+: :+: :+: */
5 /* +:+ +:+ +:+ */
6 /* By: kfujita <kfujita@student.42tokyo.jp> +#+ +:+ +#+ */
7 /* +#+#+#+#+#+ +#+ */
8 /* Created: 2022/04/06 19:24:18 by kfujita #+# #+# */
9 /* Updated: 2022/04/25 23:42:26 by kfujita ### ########.fr */
10 /* */
11 /* ************************************************************************** */
12 
13 #include <string.h>
14 #include "ft_mem.h"
15 
16 void *ft_memset(void *target, int val_to_set, size_t len_to_fill)
17 {
18  unsigned char *p_c_target;
19 
20  p_c_target = target;
21  while (len_to_fill-- > 0)
22  {
23  *p_c_target = (unsigned char)val_to_set;
24  p_c_target++;
25  }
26  return (target);
27 }
void * ft_memset(void *target, int val_to_set, size_t len_to_fill)
Definition: ft_memset.c:16