-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_memmove.c
27 lines (24 loc) · 1.14 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: nahmed-m <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2015/12/14 08:36:20 by nahmed-m #+# #+# */
/* Updated: 2015/12/14 08:36:56 by nahmed-m ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
#include <stdlib.h>
void *ft_memmove(void *dest, const void *src, size_t n)
{
char *str;
str = (char*)malloc(sizeof(src) * (n + 1));
if (str == NULL)
return (NULL);
ft_memcpy(str, src, n);
ft_memcpy(dest, str, n);
free(str);
return (dest);
}