-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_lstat.c
More file actions
32 lines (29 loc) · 1.15 KB
/
Copy pathft_lstat.c
File metadata and controls
32 lines (29 loc) · 1.15 KB
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
26
27
28
29
30
31
32
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstat.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mnishimo <mnishimo@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/11/28 22:43:32 by mnishimo #+# #+# */
/* Updated: 2019/01/12 22:34:11 by mnishimo ### ########.fr */
/* */
/* ************************************************************************** */
#include "libftprintf.h"
t_list *ft_lstat(t_list *alst, unsigned int nbr)
{
unsigned int i;
t_list *ptr;
i = 0;
if (alst == NULL)
return (NULL);
ptr = alst;
while (ptr->next != NULL && i < nbr)
{
ptr = ptr->next;
i++;
}
if (i == nbr)
return (ptr);
return (NULL);
}