added ft_malloc

This commit is contained in:
Jack Halford 2017-03-21 16:08:26 +01:00
parent 2c4eedb94f
commit 151b4ec02d
4 changed files with 29 additions and 3 deletions

View file

@ -6,7 +6,7 @@
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */ /* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/20 15:52:57 by jhalford #+# #+# */ /* Created: 2017/03/20 15:52:57 by jhalford #+# #+# */
/* Updated: 2017/03/21 15:29:36 by jhalford ### ########.fr */ /* Updated: 2017/03/21 16:08:02 by jhalford ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

View file

@ -0,0 +1,26 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_malloc.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/21 15:45:00 by jhalford #+# #+# */
/* Updated: 2017/03/21 15:45:20 by jhalford ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_malloc(size_t size)
{
void *ptr;
ptr = malloc(size);
if (!ptr)
{
ft_dprintf(2, "{red}%s{eoc}", strerror(errno));
exit(errno);
}
return (ptr);
}

View file

@ -6,7 +6,7 @@
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */ /* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/01/21 18:00:03 by jhalford #+# #+# */ /* Created: 2017/01/21 18:00:03 by jhalford #+# #+# */
/* Updated: 2017/03/20 08:41:18 by jhalford ### ########.fr */ /* Updated: 2017/03/21 15:52:26 by jhalford ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */ /* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/28 14:28:41 by jhalford #+# #+# */ /* Created: 2016/11/28 14:28:41 by jhalford #+# #+# */
/* Updated: 2017/03/21 15:49:14 by jhalford ### ########.fr */ /* Updated: 2017/03/21 15:51:03 by jhalford ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */