-
Notifications
You must be signed in to change notification settings - Fork 4
/
ft_memcpy.c
24 lines (21 loc) · 1.09 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memcpy.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ykoh <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/03/06 15:52:42 by ykoh #+# #+# */
/* Updated: 2020/10/05 23:46:09 by ykoh ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memcpy(void *dst, const void *src, size_t n)
{
const void *dstp = dst;
if (!dst && !src)
return (NULL);
while (n--)
*((unsigned char *)dstp++) = *((unsigned char *)src++);
return (dst);
}