-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_lstclear.c
More file actions
26 lines (23 loc) · 1.09 KB
/
ft_lstclear.c
File metadata and controls
26 lines (23 loc) · 1.09 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstclear.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lbiasuz <lbiasuz@student.42sp.org.br> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/04/25 00:33:03 by lbiasuz #+# #+# */
/* Updated: 2022/04/26 00:11:34 by lbiasuz ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_lstclear(t_list **list, void (*del)(void *))
{
t_list *next;
if (!(*list))
return ;
next = (*list)->next;
del((*list)->content);
free(*list);
*list = next;
ft_lstclear(list, del);
}