-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_memcpy.c
More file actions
28 lines (25 loc) · 1.17 KB
/
ft_memcpy.c
File metadata and controls
28 lines (25 loc) · 1.17 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memcpy.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: pabad-ap <pabad-ap@student.42barcel> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/09/29 21:01:51 by pabad-ap #+# #+# */
/* Updated: 2023/09/29 21:04:59 by pabad-ap ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memcpy(void *dest, const void *src, size_t n)
{
size_t pos;
pos = 0;
if ((unsigned char *)dest == 0 && (unsigned char *)src == 0)
return (NULL);
while (pos < n)
{
((unsigned char *)dest)[pos] = ((unsigned char *)src)[pos];
pos ++;
}
return ((void *)dest);
}