diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-01-18 11:54:47 +0100 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-02-04 05:33:59 +0100 |
| commit | f078f191515d0fc65340a8722fad14f3de679d7b (patch) | |
| tree | d6881ef24f6cc062332f3aa17709f693cf783b20 /src/lst | |
| parent | 014d876b691b5c0e84faa98bd308a855269e4ae4 (diff) | |
| download | libft-f078f191515d0fc65340a8722fad14f3de679d7b.tar.gz libft-f078f191515d0fc65340a8722fad14f3de679d7b.tar.bz2 libft-f078f191515d0fc65340a8722fad14f3de679d7b.zip | |
Added ft_getchar and fixing strtol
Diffstat (limited to 'src/lst')
| -rw-r--r-- | src/lst/ft_lstreverse_ret.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/lst/ft_lstreverse_ret.c b/src/lst/ft_lstreverse_ret.c new file mode 100644 index 0000000..caf6ec1 --- /dev/null +++ b/src/lst/ft_lstreverse_ret.c @@ -0,0 +1,27 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_lstreverse_ret.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/01/15 12:51:15 by cacharle #+# #+# */ +/* Updated: 2020/01/18 11:52:50 by cacharle ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +t_list *ft_lstreverse_ret(t_list *lst) +{ + t_list *tmp; + + if (lst == NULL) + return (NULL); + if (lst->next == NULL) + return (lst); + tmp = ft_lstreverse_ret(lst->next); + lst->next->next = lst; + lst->next = NULL; + return (tmp); +} |
