/* ************************************************************************** */ /* LE - / */ /* / */ /* ft_lstclear.c .:: .:/ . .:: */ /* +:+:+ +: +: +:+:+ */ /* By: rbousset +:+ +: +: +:+ */ /* #+# #+ #+ #+# */ /* Created: 2019/10/13 10:19:53 by rbousset #+# ## ## #+# */ /* Updated: 2019/10/13 13:52:03 by rbousset ### #+. /#+ ###.fr */ /* / */ /* / */ /* ************************************************************************** */ #include "libft.h" #include void ft_lstclear(t_list **lst, void (*del)(void *)) { t_list *tmp; t_list *renext; if (!lst) return ; tmp = *lst; while (tmp) { renext = tmp->next; del(tmp->content); free(tmp); tmp = renext; } *lst = NULL; }