libft/ft_strtabcpy.c
Tanguy MAZE 99ce0ff956 WIP adding functions to control word tables
added functions to create, clear, delete & copy word tables
2018-11-23 16:38:36 +01:00

30 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strtabcpy.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/11/23 14:44:53 by tmaze #+# #+# */
/* Updated: 2018/11/23 14:52:27 by tmaze ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char **ft_strtabcpy(char **dest, const char **src)
{
size_t i;
i = 0;
while (src[i])
{
if ((dest[i] = ft_strdup(src[i])) == NULL)
{
ft_strtabclr(dest);
return (NULL);
}
i++;
}
}