-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathft_memmove.c
33 lines (30 loc) · 1.17 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memmove.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: vbrazhni <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/06/30 14:02:16 by vbrazhni #+# #+# */
/* Updated: 2018/06/30 14:02:17 by vbrazhni ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memmove(void *dst, const void *src, size_t len)
{
unsigned char *d;
unsigned char *s;
d = (unsigned char *)dst;
s = (unsigned char *)src;
if (d < s)
while (len--)
*d++ = *s++;
else
{
d += len;
s += len;
while (len--)
*--d = *--s;
}
return (dst);
}