diff --git a/libft/includes/libft.h b/libft/includes/libft.h index 37fc15c2..311a94f2 100644 --- a/libft/includes/libft.h +++ b/libft/includes/libft.h @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/07 13:49:04 by jhalford #+# #+# */ -/* Updated: 2016/11/10 14:40:54 by jhalford ### ########.fr */ +/* Updated: 2016/11/11 17:47:12 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ @@ -128,4 +128,6 @@ char *ft_path_notdir(char *path); int ft_printf(const char *format, ...); char *ft_getenv(char **env, char *key); + +void *ft_realloc(void *data, int size) #endif diff --git a/libft/src/mem/ft_memalloc.c b/libft/src/mem/ft_memalloc.c index bb1bd18d..505043f8 100644 --- a/libft/src/mem/ft_memalloc.c +++ b/libft/src/mem/ft_memalloc.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/03 14:57:25 by jhalford #+# #+# */ -/* Updated: 2016/11/08 13:15:50 by jhalford ### ########.fr */ +/* Updated: 2016/11/11 17:40:57 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/libft/src/mem/ft_memchr.c b/libft/src/mem/ft_memchr.c index 47eccf3b..96ddf009 100644 --- a/libft/src/mem/ft_memchr.c +++ b/libft/src/mem/ft_memchr.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/03 14:57:28 by jhalford #+# #+# */ -/* Updated: 2016/11/03 14:57:29 by jhalford ### ########.fr */ +/* Updated: 2016/11/11 17:41:21 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/libft/src/mem/ft_memcpy.c b/libft/src/mem/ft_memcpy.c index 37e9051f..0b95291e 100644 --- a/libft/src/mem/ft_memcpy.c +++ b/libft/src/mem/ft_memcpy.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/03 14:57:31 by jhalford #+# #+# */ -/* Updated: 2016/11/08 13:17:29 by jhalford ### ########.fr */ +/* Updated: 2016/11/11 17:39:00 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/libft/src/mem/ft_memmove.c b/libft/src/mem/ft_memmove.c index 996c5cb3..904d1aca 100644 --- a/libft/src/mem/ft_memmove.c +++ b/libft/src/mem/ft_memmove.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/03 14:57:34 by jhalford #+# #+# */ -/* Updated: 2016/11/07 13:46:42 by jhalford ### ########.fr */ +/* Updated: 2016/11/11 17:41:14 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/libft/src/mem/ft_realloc.c b/libft/src/mem/ft_realloc.c new file mode 100644 index 00000000..33f6c10c --- /dev/null +++ b/libft/src/mem/ft_realloc.c @@ -0,0 +1,23 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_realloc.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/11 17:37:53 by jhalford #+# #+# */ +/* Updated: 2016/11/11 17:41:30 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +void *ft_realloc(void *data, int size) +{ + void *new; + + new = ft_memalloc(size); + ft_memcpy(new, data, size); + ft_memdel(&data); + return (new); +}