From 6cb01d2fd8a6b07ef3ddaa8bb322f30c545316e7 Mon Sep 17 00:00:00 2001 From: Charles Date: Thu, 17 Oct 2019 09:09:41 +0200 Subject: More protection - substr if start > str length - all list functions check for NULL reference - not modifying const pointers --- ft_lstdelone_bonus.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ft_lstdelone_bonus.c') diff --git a/ft_lstdelone_bonus.c b/ft_lstdelone_bonus.c index 820be26..df15e3e 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/09 09:08:36 by cacharle ### ########.fr */ +/* Updated: 2019/10/17 09:05:40 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -15,6 +15,7 @@ void ft_lstdelone(t_list *lst, void (*del)(void *)) { - (*del)(lst->content); + if (lst != NULL && del != NULL) + (*del)(lst->content); free(lst); } -- cgit