-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_memcpy.c
26 lines (24 loc) · 1.17 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memcpy.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lignigno <lignign@student.21-school.ru> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/10/15 13:28:48 by lumfred #+# #+# */
/* Updated: 2021/10/20 14:08:39 by lumfred ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memcpy(void *dest, const void *src, size_t n)
{
unsigned char *dest_tmp;
unsigned char *src_tmp;
if (src == NULL && dest == NULL)
return (NULL);
dest_tmp = (unsigned char *)dest;
src_tmp = (unsigned char *)src;
while (n--)
*dest_tmp++ = *src_tmp++;
return (dest);
}