/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_list_at.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/08/14 13:18:48 by jhalford #+# #+# */ /* Updated: 2016/08/18 16:46:36 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ #include #include #include "ft_list.h" t_list *ft_list_at(t_list *begin_list, unsigned int nbr) { unsigned int i; if (!begin_list) return (NULL); i = 0; while (i < nbr) { if (begin_list->next) begin_list = begin_list->next; else return (NULL); i++; } return (begin_list); }