-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_memmove.c
28 lines (25 loc) · 1.1 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memmove.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: aabduvak <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/12/28 05:50:53 by aabduvak #+# #+# */
/* Updated: 2021/12/28 05:50:53 by aabduvak ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memmove(void *dest, const void *src, size_t len)
{
char *a;
char *b;
a = (char *) src;
b = (char *) dest;
if (a < b)
while (len--)
b[len] = a[len];
else
ft_memcpy(b, a, len);
return (dest);
}