Libft aortigos

This commit is contained in:
Angel Ortigosa Perez
2025-11-15 09:18:35 +01:00
commit c87ab67280
45 changed files with 1439 additions and 0 deletions

26
ft_lstlast_bonus.c Normal file
View File

@@ -0,0 +1,26 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstlast.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: aortigos <aortigos@student.42malaga.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/10/22 20:25:15 by aortigos #+# #+# */
/* Updated: 2023/10/22 20:37:37 by aortigos ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
t_list *ft_lstlast(t_list *lst)
{
if (!lst)
return (NULL);
while (lst)
{
if (!lst->next)
return (lst);
lst = lst->next;
}
return (lst);
}