minishell/libft/ft_lstnew_bonus.c
2025-06-04 14:58:04 +02:00

26 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstnew.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: vvobis <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/09 11:10:05 by vvobis #+# #+# */
/* Updated: 2024/04/09 18:59:48 by vvobis ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
t_list *ft_lstnew(void *content)
{
t_list *tmp;
tmp = malloc(sizeof(*tmp));
if (!tmp)
return (NULL);
tmp->next = NULL;
tmp->content = content;
return (tmp);
}