diff options
Diffstat (limited to 'libft/ft_lstnew.c')
-rw-r--r-- | libft/ft_lstnew.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/libft/ft_lstnew.c b/libft/ft_lstnew.c new file mode 100644 index 0000000..6ccb7a8 --- /dev/null +++ b/libft/ft_lstnew.c @@ -0,0 +1,25 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_lstnew.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: kdx <kdx @student.42angouleme.fr +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2022/09/29 02:49:36 by kdx #+# #+# */ +/* Updated: 2022/09/29 02:50:55 by kdx ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +t_list *ft_lstnew(void *content) +{ + t_list *lst; + + lst = malloc(sizeof(t_list)); + if (lst == NULL) + return (NULL); + lst->content = content; + lst->next = NULL; + return (lst); +} |