-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_lstdelone.c
executable file
·23 lines (21 loc) · 1.08 KB
/
ft_lstdelone.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstdelone.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mframbou <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/07 22:30:03 by mframbou #+# #+# */
/* Updated: 2021/08/08 22:15:31 by mframbou ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdlib.h>
#include "libft.h"
// If content is NULL, size should be 0 so no need to check
void ft_lstdelone(t_list *lst, void (*del)(void *))
{
if (!lst)
return ;
(*del)(lst->content);
free(lst);
}