-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_memmove.c
More file actions
33 lines (30 loc) · 1.2 KB
/
Copy pathft_memmove.c
File metadata and controls
33 lines (30 loc) · 1.2 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
31
32
33
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memmove.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: houkaamo <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/10/15 18:08:42 by houkaamo #+# #+# */
/* Updated: 2025/11/03 10:51:34 by houkaamo ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memmove(void *dest, const void *src, size_t n)
{
unsigned char *p_dest;
unsigned const char *p_src;
p_dest = (unsigned char *)dest;
p_src = (unsigned const char *)src;
if (p_dest > p_src)
{
while (n--)
p_dest[n] = p_src[n];
}
else
{
while (n--)
*p_dest++ = *p_src++;
}
return (dest);
}