-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_memdup.c
25 lines (22 loc) · 1.07 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
25
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memdup.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: kyork <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/09/23 10:52:02 by kyork #+# #+# */
/* Updated: 2016/09/23 10:57:44 by kyork ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
#include <stdlib.h>
void *ft_memdup(const void *mem, size_t size)
{
void *dst;
dst = (void*)malloc(size);
if (!dst)
return (0);
ft_memcpy(dst, mem, size);
return (dst);
}