-
Notifications
You must be signed in to change notification settings - Fork 1
/
ft_memcpy.c
executable file
·32 lines (29 loc) · 1.14 KB
/
ft_memcpy.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memcpy.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rel-fila <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/08 11:10:43 by rel-fila #+# #+# */
/* Updated: 2022/10/18 21:24:56 by rel-fila ### ########.fr */
/* */
/* ************************************************************************** */
#include <strings.h>
void *ft_memcpy(void *dst, const void *src, size_t n)
{
size_t i;
char *ds;
char *sr;
i = 0;
if (dst == NULL && src == NULL)
return (NULL);
ds = (char *) dst;
sr = (char *) src;
while (i < n)
{
ds[i] = sr[i];
i++;
}
return (dst);
}