30 lines
1 KiB
C
30 lines
1 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_lst_size.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2016/11/04 11:09:35 by jhalford #+# #+# */
|
|
/* Updated: 2016/11/04 11:09:36 by jhalford ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "libft.h"
|
|
|
|
int ft_lstsize(t_list *lst)
|
|
{
|
|
int i;
|
|
|
|
i = 0;
|
|
if (lst)
|
|
{
|
|
i = 1;
|
|
while (lst->next)
|
|
{
|
|
lst = lst->next;
|
|
i++;
|
|
}
|
|
}
|
|
return (i);
|
|
}
|