add lstremove_next and lstadd_back now return

This commit is contained in:
hugogogo
2022-03-23 21:52:04 +01:00
parent 39b3f2bc4e
commit bc53060626
5 changed files with 47 additions and 13 deletions

View File

@@ -6,7 +6,7 @@
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/11/25 14:16:20 by hulamy #+# #+# */
/* Updated: 2019/11/25 14:29:46 by hulamy ### ########.fr */
/* Updated: 2022/03/23 20:24:40 by simplonco ### ########.fr */
/* */
/* ************************************************************************** */
@@ -48,12 +48,10 @@ t_list *ft_lstnew(void *content)
{
t_list *lst;
if (!(lst = (t_list *)malloc(sizeof(*lst))))
lst = (t_list *)malloc(sizeof(*lst));
if (!lst)
return (NULL);
if (!content)
lst->content = NULL;
else
lst->content = content;
lst->content = content;
lst->next = NULL;
return (lst);
}