-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_realloc.c
23 lines (20 loc) · 1.09 KB
/
ft_realloc.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_realloc.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ylagtab <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/08/30 01:42:48 by vanderwolk #+# #+# */
/* Updated: 2021/01/15 19:21:31 by ylagtab ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_realloc(void *addr, size_t old_size, size_t new_size)
{
void *ret_addr;
if ((ret_addr = ft_malloc(new_size)) == NULL)
return (NULL);
ft_memcpy(ret_addr, addr, old_size);
return (ret_addr);
}