-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_strnew.c
24 lines (21 loc) · 1.06 KB
/
ft_strnew.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strnew.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cprune <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2015/11/30 10:01:37 by cprune #+# #+# */
/* Updated: 2015/12/05 18:32:32 by cprune ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
#include <stdlib.h>
char *ft_strnew(size_t size)
{
char *str;
if (!(str = (char *)malloc(sizeof(char) * size + 1)))
return (NULL);
ft_strclr(str);
return (str);
}