/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_nstr.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: rbousset +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/02/14 17:06:43 by rbousset #+# #+# */ /* Updated: 2020/02/14 17:06:43 by rbousset ### ########lyon.fr */ /* */ /* ************************************************************************** */ #include #include char *ft_nstr(size_t size) { char *str; size_t i; i = 0; size += 1; if (!(str = (char*)malloc((size) * sizeof(char)))) return (NULL); while (i < size) { str[i] = '\0'; i++; } return (str); }