-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_memmove.c
27 lines (24 loc) · 1.13 KB
/
ft_memmove.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memmove.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ssalaues <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/01 14:50:32 by ssalaues #+# #+# */
/* Updated: 2017/01/09 15:03:10 by ssalaues ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memmove(void *dst, const void *src, size_t len)
{
unsigned char *tmp;
tmp = (unsigned char *)malloc(sizeof(unsigned char) * len + 1);
if (tmp)
{
ft_memcpy(tmp, src, len);
ft_memcpy(dst, tmp, len);
}
free(tmp);
return (dst);
}