24 lines
1.0 KiB
C
24 lines
1.0 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_strnew.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: tchivert <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2019/04/07 12:05:36 by tchivert #+# #+# */
|
|
/* Updated: 2019/09/04 05:13:34 by tchivert ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "libft.h"
|
|
|
|
char *ft_strnew(size_t size)
|
|
{
|
|
char *str;
|
|
|
|
if (!(str = (char *)malloc(sizeof(char) * size + 1)))
|
|
return (NULL);
|
|
ft_bzero(str, size + 1);
|
|
return (str);
|
|
}
|