aboutsummaryrefslogtreecommitdiff
path: root/c12/ex03/ft_list_last.c
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2019-07-24 08:02:55 +0200
committerCharles <sircharlesaze@gmail.com>2019-07-24 08:02:55 +0200
commit5bab06313e71e9827baa426a02bbaf2a00b4e6a0 (patch)
tree5604e51c0008088f25b2f5dfb9143a852dd079dd /c12/ex03/ft_list_last.c
parent23ad79e8b41c25bb4992d103d29a17612a52e351 (diff)
downloadpiscine-5bab06313e71e9827baa426a02bbaf2a00b4e6a0.tar.gz
piscine-5bab06313e71e9827baa426a02bbaf2a00b4e6a0.tar.bz2
piscine-5bab06313e71e9827baa426a02bbaf2a00b4e6a0.zip
c12 passed, c13 start
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);