-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_strnew.c
More file actions
25 lines (22 loc) · 1.1 KB
/
Copy pathft_strnew.c
File metadata and controls
25 lines (22 loc) · 1.1 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strnew.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ophuong <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/09/10 19:13:06 by ophuong #+# #+# */
/* Updated: 2019/09/18 13:02:47 by ophuong ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strnew(size_t size)
{
char *fresh;
if (size > size + 1)
return (NULL);
if (!(fresh = (char*)malloc(sizeof(char) * (size + 1))))
return (NULL);
ft_memset(fresh, '\0', size + 1);
return (fresh);
}