-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathft_memmove.c
More file actions
25 lines (23 loc) · 1.14 KB
/
ft_memmove.c
File metadata and controls
25 lines (23 loc) · 1.14 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: mimeyer <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/05/19 11:52:06 by mimeyer #+# #+# */
/* Updated: 2019/05/28 11:10:25 by mimeyer ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memmove(void *dest, const void *src, size_t n)
{
if (dest == NULL && src == NULL)
return (NULL);
if (dest < src)
ft_memcpy(dest, src, n);
else
while (n--)
*(unsigned char *)(dest + n) = *(unsigned char *)(src + n);
return (dest);
}