-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_memdup.c
24 lines (21 loc) · 1.08 KB
/
ft_memdup.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memdup.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: thakala <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/11/20 09:36:55 by thakala #+# #+# */
/* Updated: 2021/11/20 09:40:05 by thakala ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
#include <stdlib.h>
void *ft_memdup(const void *memory, size_t size)
{
void *duplicate;
duplicate = malloc(size);
if (duplicate)
ft_memcpy(duplicate, memory, size);
return (duplicate);
}