diff options
| author | Charles <sircharlesaze@gmail.com> | 2019-07-17 19:30:52 +0200 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2019-07-17 19:30:52 +0200 |
| commit | 880102ae9358db130ef67cc9a7177a1e1de76875 (patch) | |
| tree | b5929722cf123e7c1701f4bc164a905f79510bf5 /c12/ex01 | |
| parent | dcf89e9366538c70fc08ceaabd5b770f5d5b890d (diff) | |
| download | piscine-880102ae9358db130ef67cc9a7177a1e1de76875.tar.gz piscine-880102ae9358db130ef67cc9a7177a1e1de76875.tar.bz2 piscine-880102ae9358db130ef67cc9a7177a1e1de76875.zip | |
c10 tail stuff, c11 start, c12/c13 files
Diffstat (limited to 'c12/ex01')
| -rw-r--r-- | c12/ex01/ft_list_push_front.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/c12/ex01/ft_list_push_front.c b/c12/ex01/ft_list_push_front.c index 788fce1..76fedd9 100644 --- a/c12/ex01/ft_list_push_front.c +++ b/c12/ex01/ft_list_push_front.c @@ -6,19 +6,18 @@ /* By: cacharle <charles.cabergs@gmail.com> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/07/09 17:19:14 by cacharle #+# #+# */ -/* Updated: 2019/07/09 17:19:15 by cacharle ### ########.fr */ +/* Updated: 2019/07/17 17:10:46 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ + #include "ft_list.h" void ft_list_push_front(t_list **begin_list, void *data) { - t_list new_front; + t_list *new_front; - new_front = (t_list*)malloc(sizeof(t_list)); - new_front->data = data; + new_front = ft_create_elem(data); new_front->next = *begin_list; - if (*begin_list) - *begin_list = new_front; + *begin_list = new_front; } |
