-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_lstpush.c
33 lines (30 loc) · 1.12 KB
/
ft_lstpush.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
32
33
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstpush.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: bpezeshk <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/01/19 00:30:08 by bpezeshk #+# #+# */
/* Updated: 2017/01/19 13:05:26 by bpezeshk ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_lstpush(t_list **alst, t_list *new)
{
t_list *strt;
if (!alst)
return ;
if (*alst)
{
strt = *alst;
while ((*alst)->next)
*alst = (*alst)->next;
(*alst)->next = new;
*alst = strt;
}
else
{
*alst = new;
}
}