-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_strnew.c
27 lines (24 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
25
26
27
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strnew.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tmoska <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/17 22:32:36 by tmoska #+# #+# */
/* Updated: 2016/11/17 22:32:37 by tmoska ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdlib.h>
#include "libft.h"
char *ft_strnew(size_t size)
{
char *str;
if ((str = (char *)malloc(size + 1)))
{
ft_bzero(str, size + 1);
return (str);
}
else
return (NULL);
}