-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathft_memmove.c
34 lines (31 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
28
29
30
31
32
33
34
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memmove.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: smbaabu <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/02/19 16:07:39 by smbaabu #+# #+# */
/* Updated: 2019/02/25 23:19:05 by smbaabu ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memmove(void *dst, const void *src, size_t len)
{
char *s;
char *d;
size_t i;
s = (char *)src;
d = (char *)dst;
i = 0;
if (d > s)
while (len-- > 0)
d[len] = s[len];
else
while (i < len)
{
d[i] = s[i];
i++;
}
return (dst);
}