-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_lstclear_bonus.c
27 lines (24 loc) · 1.09 KB
/
ft_lstclear_bonus.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstclear_bonus.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: atoof <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/11/23 14:24:53 by atoof #+# #+# */
/* Updated: 2022/11/23 15:07:32 by atoof ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_lstclear(t_list **lst, void (*del)(void *))
{
t_list *begin;
if (!lst || !*lst)
return ;
while (*lst != NULL)
{
begin = (*lst)->next;
ft_lstdelone((*lst), del);
(*lst) = begin;
}
}