-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_lstlast_bonus.c
25 lines (23 loc) · 1.09 KB
/
ft_lstlast_bonus.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstlast.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: estettle <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/07 18:23:01 by estettle #+# #+# */
/* Updated: 2024/10/07 18:40:37 by estettle ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/* ft_lstlast()
* returns a pointer to the last item of the list pointed to by *lst.
*/
t_list *ft_lstlast(t_list *lst)
{
if (!lst)
return (NULL);
while (lst->next)
lst = lst->next;
return (lst);
}