-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_memmove.c
32 lines (29 loc) · 1.11 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
29
30
31
32
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memmove.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ybouzgao <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/11/09 14:04:06 by ybouzgao #+# #+# */
/* Updated: 2017/11/09 15:08:30 by ybouzgao ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memmove(void *dest, const void *src, size_t n)
{
char *d;
char *s;
size_t i;
d = (char*)dest;
s = (char*)src;
i = 0;
if (s < d)
{
while (n--)
d[n] = s[n];
}
else
ft_memcpy(d, s, n);
return (d);
}