libft/ft_strtabnew.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

25 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strtabnew.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/11/23 14:13:08 by tmaze #+# #+# */
/* Updated: 2018/11/23 14:38:11 by tmaze ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char **ft_strtabnew(size_t size)
{
char **ret;
if (size <= 0 || (ret = (char**)ft_memalloc(sizeof(char*) * (size + 1))) == NULL)
return (NULL);
while (size >= 0)
ret[size - 1] = NULL;
return (ret);
}