libft/srcs/lst/ft_lstnew.c

14 lines
No EOL
210 B
C

#include "libft.h"
t_list *ft_lstnew(void *data)
{
t_list *node = (t_list *)malloc(sizeof(t_list));
if (!node)
return (NULL);
node->data = data;
node->next = NULL;
return node;
}