-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_memmove.c
More file actions
executable file
·30 lines (27 loc) · 1.15 KB
/
ft_memmove.c
File metadata and controls
executable file
·30 lines (27 loc) · 1.15 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memmove.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: frcugy <frcugy@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2014/11/03 14:10:48 by frcugy #+# #+# */
/* Updated: 2014/11/03 14:10:48 by frcugy ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memmove(void *dst, const void *src, size_t len)
{
size_t i;
i = 0;
if (dst < src)
while (len--)
{
((char*)dst)[i] = (((char*)src)[i]);
i++;
}
else
while (len--)
*((char *)dst + len) = *((char *)src + len);
return ((void*)dst);
}