26 lines
1.1 KiB
C
Executable file
26 lines
1.1 KiB
C
Executable file
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_lstnew_bonus.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: thrieg <thrieg@student.42mulhouse.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2024/10/16 11:54:17 by thrieg #+# #+# */
|
|
/* Updated: 2025/02/16 19:04:02 by thrieg ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "libft.h"
|
|
|
|
//returns NULL if any allocation fails
|
|
t_list *ft_lstnew(void *content)
|
|
{
|
|
t_list *ret;
|
|
|
|
ret = malloc(sizeof(t_list));
|
|
if (!ret)
|
|
return (NULL);
|
|
ret->content = content;
|
|
ret->next = NULL;
|
|
return (ret);
|
|
}
|