aboutsummaryrefslogtreecommitdiff
path: root/c12/ex03/ft_list_last.c
diff options
context:
space:
mode:
Diffstat (limited to 'c12/ex03/ft_list_last.c')
-rw-r--r--c12/ex03/ft_list_last.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/c12/ex03/ft_list_last.c b/c12/ex03/ft_list_last.c
index 84a46c2..2164e34 100644
--- a/c12/ex03/ft_list_last.c
+++ b/c12/ex03/ft_list_last.c
@@ -6,14 +6,17 @@
/* By: cacharle <charles.cabergs@gmail.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/07/09 17:18:58 by cacharle #+# #+# */
-/* Updated: 2019/07/17 17:30:36 by cacharle ### ########.fr */
+/* Updated: 2019/07/23 15:37:03 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
+#include <stdlib.h>
#include "ft_list.h"
t_list *ft_list_last(t_list *begin_list)
{
+ if (begin_list == NULL)
+ return (NULL);
while (begin_list->next != NULL)
begin_list = begin_list->next;
return (begin_list);