-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_lstlast.c
More file actions
31 lines (28 loc) · 1.16 KB
/
ft_lstlast.c
File metadata and controls
31 lines (28 loc) · 1.16 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
29
30
31
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstlast.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jowagner <jowagner@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/11/30 21:13:08 by jowagner #+# #+# */
/* Updated: 2024/12/12 19:48:50 by jowagner ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/**
* @brief Returns the last node of the list.
*
* @param lst The beginning of the list.
* @return Last node of the list.
*/
t_list *ft_lstlast(t_list *lst)
{
t_list *tmp;
if (!lst)
return (NULL);
tmp = lst;
while (tmp->next)
tmp = tmp->next;
return (tmp);
}