-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_memcpy.c
More file actions
34 lines (31 loc) · 1.18 KB
/
Copy pathft_memcpy.c
File metadata and controls
34 lines (31 loc) · 1.18 KB
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
33
34
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memcpy.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: nmncube <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/05/25 11:03:35 by nmncube #+# #+# */
/* Updated: 2019/06/26 12:27:07 by nmncube ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memcpy(void *dst, const void *src, size_t n)
{
size_t j;
unsigned char *s1;
unsigned char *s2;
if (!dst && !src)
return (NULL);
s1 = (unsigned char*)src;
s2 = (unsigned char*)dst;
j = 0;
if (n < 1)
return (dst);
while (j < n)
{
s2[j] = s1[j];
j++;
}
return (dst);
}