-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_lstclear_bonus.c
More file actions
29 lines (26 loc) · 1.11 KB
/
ft_lstclear_bonus.c
File metadata and controls
29 lines (26 loc) · 1.11 KB
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
28
29
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstclear_bonus.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: pabad-ap <pabad-ap@student.42barcel> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/10/10 20:03:47 by pabad-ap #+# #+# */
/* Updated: 2023/10/10 20:35:49 by pabad-ap ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_lstclear(t_list **lst, void (*del) (void*))
{
t_list *tmp;
t_list *tmp_next;
tmp = *lst;
tmp_next = NULL;
while (tmp)
{
tmp_next = tmp->next;
ft_lstdelone(tmp, del);
tmp = tmp_next;
}
*lst = NULL;
}