-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_memmove.c
28 lines (25 loc) · 1.15 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
28
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memmove.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: igarbuz <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/11/12 11:59:01 by igarbuz #+# #+# */
/* Updated: 2018/11/16 15:04:59 by igarbuz ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memmove(void *dst, const void *src, size_t len)
{
char *mystr;
if ((int *)src > (int *)dst)
return (ft_memcpy(dst, src, len));
else
{
mystr = (char *)dst;
while ((int)--len >= 0)
*(mystr + len) = *((char *)src + len);
}
return (dst);
}