-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_memcpy.c
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: lsasse <lsasse@student.42berlin.de> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/21 18:25:07 by lsasse #+# #+# */
/* Updated: 2023/11/27 14:41:04 by lsasse ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memcpy(void *dest, const void *src, size_t n)
{
unsigned char *p;
const unsigned char *s;
p = dest;
s = src;
if ((void *)dest == 0 && (void *)src == 0)
return (0);
while (n > 0)
{
*p = *s;
p++;
s++;
n--;
}
return (dest);
}