Projet de l'école 42 : Libft
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

27 lines
1.1 KiB

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstclear_bonus.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: narnaud <narnaud@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/10/22 14:53:04 by narnaud #+# #+# */
/* Updated: 2021/11/15 13:07:08 by narnaud ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_lstclear(t_list **lst, void (*del)(void *))
{
t_list *next_cell;
if (!del)
return ;
while (lst && *lst)
{
next_cell = (*lst)->next;
ft_lstdelone(*lst, del);
*lst = next_cell;
}
}