-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_memcpy.c
31 lines (28 loc) · 1.13 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memcpy.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: edebi <edebi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/10/28 15:39:40 by edebi #+# #+# */
/* Updated: 2020/11/03 17:32:37 by edebi ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memcpy(void *dst, const void *src, size_t n)
{
const char *n_src;
char *n_dst;
if (dst == NULL && src == NULL)
return (NULL);
n_src = src;
n_dst = dst;
while (n--)
{
*n_dst = *n_src;
n_dst++;
n_src++;
}
return (dst);
}