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_lstadd_front_bonus.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ft_lstadd_front_bonus.c') diff --git a/ft_lstadd_front_bonus.c b/ft_lstadd_front_bonus.c index a29c5c2..462f85e 100644 --- a/ft_lstadd_front_bonus.c +++ b/ft_lstadd_front_bonus.c @@ -6,7 +6,7 @@ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/10/09 09:02:25 by cacharle #+# #+# */ -/* Updated: 2019/10/09 09:07:57 by cacharle ### ########.fr */ +/* Updated: 2019/10/17 09:06:38 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -14,6 +14,8 @@ void ft_lstadd_front(t_list **alst, t_list *new) { + if (alst == NULL) + return ; new->next = *alst; *alst = new; } -- cgit