-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_memcpy.c
32 lines (29 loc) · 1.2 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* memcpy.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: igilbert <[email protected]. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/23 00:00:23 by ivan #+# #+# */
/* Updated: 2024/11/04 23:13:44 by igilbert ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memcpy(void *restrict dst, const void *restrict src, size_t n)
{
size_t i;
unsigned char *mst;
unsigned char *std;
mst = (unsigned char *)dst;
std = (unsigned char *)src;
if (mst == NULL && std == NULL)
return (dst);
i = 0;
while (i < n)
{
mst[i] = std[i];
i++;
}
return (dst);
}