-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_add_list.c
31 lines (28 loc) · 1.18 KB
/
ft_add_list.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_add_list.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: akerkeb <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/01/21 23:11:33 by akerkeb #+# #+# */
/* Updated: 2016/01/21 23:40:41 by akerkeb ### ########.fr */
/* */
/* ************************************************************************** */
#include "fillit.h"
t_tetri *ft_add_on_list(t_tetri *head, t_tetri *l_tmp, int x)
{
t_tetri *tmp;
if (x != 0)
{
tmp = head;
while (head->next != NULL)
head = head->next;
head->next = (t_tetri *)malloc(sizeof(t_tetri));
head->next = l_tmp;
return (tmp);
}
else
head = l_tmp;
return (head);
}