-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_memmove.c
26 lines (23 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memmove.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jkeuleya <jkeuleya@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2014/11/08 17:18:45 by jkeuleya #+# #+# */
/* Updated: 2014/11/08 18:46:36 by jkeuleya ### ########.fr */
/* */
/* ************************************************************************** */
#include <unistd.h>
#include <stdlib.h>
#include "libft.h"
void *ft_memmove(void *dst, const void *src, size_t len)
{
char *cp;
cp = (char*)malloc(sizeof(char*) * len);
cp = ft_strncpy(cp, src, len);
dst = (void*)ft_strncpy(dst, cp, len);
free(cp);
return (dst);
}