-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_memmove.c
executable file
·30 lines (27 loc) · 1.12 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memmove.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jraymond <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/11/11 00:14:53 by jraymond #+# #+# */
/* Updated: 2017/11/16 16:25:08 by jraymond ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memmove(void *dest, const void *src, size_t n)
{
size_t i;
if (dest < src)
ft_memcpy(dest, src, n);
else
{
i = n;
while (i--)
{
*(unsigned char*)(dest + i) = *(unsigned char*)(src + i);
}
}
return (dest);
}