Files
push_swap/libft/ft_lstclear_bonus.c
T
2025-11-16 09:48:49 +01:00

29 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstclear.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lfirmin <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/06/01 20:46:07 by lfirmin #+# #+# */
/* Updated: 2024/06/01 20:51:07 by lfirmin ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_lstclear(t_list **lst, void (*del)(void*))
{
t_list *t;
if (lst)
{
while (*lst)
{
t = (*lst)->next;
ft_lstdelone(*lst, del);
(*lst) = t;
}
(*lst) = NULL;
}
}