aboutsummaryrefslogtreecommitdiff
path: root/ft_lstsize.c
blob: 43242699a4c7d58b1037b503cd82ec0c72c080d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <stdlib.h>
#include "libft.h"

int ft_lstsize(t_list *lst)
{
    int counter;

    counter = 0;
    while (lst != NULL)
    {
        counter++;
        lst = lst->next;
    }
    return (counter);
}