-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_strnew.c
26 lines (23 loc) · 1.07 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strnew.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: albarret <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/11/06 11:18:57 by albarret #+# #+# */
/* Updated: 2018/11/12 21:52:16 by albarret ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strnew(size_t size)
{
size_t i;
char *string;
if (!(string = ft_memalloc(size + 1)))
return (NULL);
i = 0;
while (i < size)
string[i++] = '\0';
return (string);
}