/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_tabdup.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: bchanot +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/14 00:38:32 by bchanot #+# #+# */ /* Updated: 2018/10/14 03:20:22 by bchanot ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" char **ft_tabdup(char **tabl) { size_t i; char **ret; if (!tabl) return (0); if (!(ret = (char **)ft_memalloc(sizeof(char *) * (ft_tablen(tabl) + 1)))) return (NULL); i = -1; while (tabl[++i]) ret[i] = ft_strdup(tabl[i]); ret[i] = 0; return (ret); }