-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_lstpush.c
More file actions
executable file
·28 lines (25 loc) · 1.1 KB
/
ft_lstpush.c
File metadata and controls
executable file
·28 lines (25 loc) · 1.1 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstpush.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: luperez <luperez@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2014/11/16 06:36:51 by luperez #+# #+# */
/* Updated: 2014/12/02 07:12:57 by luperez ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
t_list *ft_lstpush(t_list **alst, t_list *new)
{
t_list *tmp;
if (!new)
return (NULL);
if (!alst || !*alst)
return (new);
tmp = *alst;
while (tmp->next)
tmp = tmp->next;
tmp->next = new;
return (new);
}