-
Notifications
You must be signed in to change notification settings - Fork 0
/
list_append.c
31 lines (28 loc) · 1.17 KB
/
list_append.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* list_append.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mschroed <mschroed@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/12/30 20:41:16 by mschroed #+# #+# */
/* Updated: 2019/01/06 10:58:11 by mschroed ### ########.fr */
/* */
/* ************************************************************************** */
#include "fillit.h"
#include <libft.h>
void lst_append(t_mino **head, char *buf)
{
t_mino *new_mino;
t_mino *last;
last = *head;
new_mino = fnew_mino(buf, 21);
if (*head == NULL)
{
*head = fnew_mino(buf, 21);
return ;
}
while (last->next != NULL)
last = last->next;
last->next = new_mino;
}