28 lines
1.1 KiB
C
28 lines
1.1 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_list_push_back.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2016/08/14 13:13:13 by jhalford #+# #+# */
|
|
/* Updated: 2016/08/16 21:58:22 by jhalford ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "ft_list.h"
|
|
|
|
void ft_list_push_back(t_list **begin_list, void *data)
|
|
{
|
|
t_list *list;
|
|
|
|
list = *begin_list;
|
|
if (list)
|
|
{
|
|
while (list->next)
|
|
list = list->next;
|
|
list->next = ft_create_elem(data);
|
|
}
|
|
else
|
|
*begin_list = ft_create_elem(data);
|
|
}
|