29 lines
1.2 KiB
C
29 lines
1.2 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_lstlast.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2023/11/12 11:42:54 by rparodi #+# #+# */
|
|
/* Updated: 2025/09/01 16:36:47 by rparodi ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "list.h"
|
|
#include <unistd.h>
|
|
|
|
/**
|
|
* @brief Found the last element of the chained list
|
|
*
|
|
* @param lst the chained list
|
|
* @return the last element of the chained list
|
|
*/
|
|
t_list *ft_lstlast(t_list *lst)
|
|
{
|
|
if (lst == NULL)
|
|
return (lst);
|
|
while (lst->next != NULL)
|
|
lst = lst->next;
|
|
return (lst);
|
|
}
|