-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_memmove.c
More file actions
25 lines (24 loc) · 1.11 KB
/
ft_memmove.c
File metadata and controls
25 lines (24 loc) · 1.11 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memmove.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: nle-roux <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/10/30 16:07:21 by nle-roux #+# #+# */
/* Updated: 2023/11/11 16:50:23 by nle-roux ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memmove(void *dest, const void *src, size_t n)
{
if (dest > src)
{
while (n-- > 0)
((char *)dest)[n] = ((char *)src)[n];
return (dest);
}
else if (src > dest)
ft_memcpy(dest, src, n);
return (dest);
}