-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_strnew.c
27 lines (24 loc) · 1.08 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
25
26
27
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strnew.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: elivet <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2013/11/25 20:45:46 by elivet #+# #+# */
/* Updated: 2013/12/01 19:08:20 by elivet ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdlib.h>
#include <string.h>
#include "ft_p.h"
char *ft_strnew(size_t size)
{
char *str;
str = NULL;
str = (char *)malloc(size + 1);
if (str == NULL)
return (NULL);
ft_strclr(str);
return (str);
}