woody-woodpacker/ft_printf/libft/ft_lstnew.c

25 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstnew_bonus.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: pbonilla <eirodeis.lepnj@gmail.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/12/04 16:06:31 by pbonilla #+# #+# */
/* Updated: 2020/12/04 16:06:31 by pbonilla ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
t_list *ft_lstnew(void *content)
{
t_list *new;
if (!(new = malloc(sizeof(t_list))))
return (NULL);
new->content = content;
new->next = NULL;
return (new);
}