-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_memcpy.c
32 lines (29 loc) · 1.22 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: jvico-ga <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/09/14 20:10:19 by jvico-ga #+# #+# */
/* Updated: 2021/09/24 20:16:34 by jvico-ga ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memcpy(void *dst, const void *src, size_t n)
{
size_t count;
unsigned char *s_dst;
const unsigned char *s_src;
if (dst == NULL && src == NULL)
return (dst);
s_dst = (unsigned char *)dst;
s_src = (unsigned char *)src;
count = 0;
while (count != n)
{
s_dst[count] = s_src[count];
count++;
}
return (dst);
}