From 43e6c82cad5d790c75c918a4eca85cdec894d1c8 Mon Sep 17 00:00:00 2001 From: Charles Date: Fri, 18 Oct 2019 15:31:00 +0200 Subject: Fixed ft_substr, added a few protection to list functions --- ft_lstdelone_bonus.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'ft_lstdelone_bonus.c') diff --git a/ft_lstdelone_bonus.c b/ft_lstdelone_bonus.c index df15e3e..9030da3 100644 --- a/ft_lstdelone_bonus.c +++ b/ft_lstdelone_bonus.c @@ -6,7 +6,7 @@ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/10/09 09:03:02 by cacharle #+# #+# */ -/* Updated: 2019/10/17 09:05:40 by cacharle ### ########.fr */ +/* Updated: 2019/10/18 12:20:38 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -15,7 +15,8 @@ void ft_lstdelone(t_list *lst, void (*del)(void *)) { - if (lst != NULL && del != NULL) - (*del)(lst->content); + if (lst == NULL || del == NULL) + return ; + (*del)(lst->content); free(lst); } -- cgit