fix: lst -> slist
This commit is contained in:
parent
93da2c9ca6
commit
14adc54215
16 changed files with 48 additions and 46 deletions
22
srcs/slist/ft_slist_push.c
Normal file
22
srcs/slist/ft_slist_push.c
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#include "libft.h"
|
||||
|
||||
void ft_slist_push(t_slist **lst, t_slist *node)
|
||||
{
|
||||
t_slist *current;
|
||||
|
||||
if (!lst || !node)
|
||||
return;
|
||||
|
||||
node->next = NULL;
|
||||
|
||||
if (*lst == NULL)
|
||||
{
|
||||
*lst = node;
|
||||
return;
|
||||
}
|
||||
|
||||
current = *lst;
|
||||
while (current->next != NULL)
|
||||
current = current->next;
|
||||
current->next = node;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue