-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_memcpy.c
32 lines (29 loc) · 1.21 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: rcappend <[email protected]> +#+ */
/* +#+ */
/* Created: 2020/10/29 15:41:53 by rcappend #+# #+# */
/* Updated: 2021/11/03 14:23:37 by rcappend ######## odam.nl */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memcpy(void *dst, void *src, size_t n)
{
unsigned char *temp_dst;
unsigned char *temp_src;
temp_dst = (unsigned char *)dst;
temp_src = (unsigned char *)src;
if (temp_dst == NULL && temp_src == NULL)
return (NULL);
while (n > 0)
{
*temp_dst = *temp_src;
temp_src++;
temp_dst++;
n--;
}
return (dst);
}