-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_memmove.c
27 lines (24 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memmove.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lenzo-pe <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/02/06 13:47:40 by lenzo-pe #+# #+# */
/* Updated: 2021/05/07 15:01:15 by lenzo-pe ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_string.h"
void *ft_memmove(void *dest, const void *src, size_t len)
{
unsigned char *str1;
unsigned char *str2;
str1 = (unsigned char *)dest;
str2 = (unsigned char *)src;
if (src >= dest)
return (ft_memcpy(dest, src, len));
while (len--)
str1[len] = str2[len];
return (str1);
}