-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_numlst_newnode.c
33 lines (30 loc) · 1.27 KB
/
ft_numlst_newnode.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
28
29
30
31
32
33
/* ************************************************************************** */
/* */
/* :::::::: */
/* ft_numlst_newnode.c :+: :+: */
/* +:+ */
/* By: aholster <[email protected]> +#+ */
/* +#+ */
/* Created: 2019/07/27 18:24:47 by aholster #+# #+# */
/* Updated: 2019/08/12 11:03:21 by aholster ######## odam.nl */
/* */
/* ************************************************************************** */
#include "float_tech.h"
t_numlst *ft_numlst_newnode(void)
{
t_numlst *node;
node = (t_numlst *)malloc(sizeof(t_numlst));
if (node == NULL)
return (NULL);
node->mem = (char *)malloc(sizeof(char) * LSTBUF_SIZE);
if (node->mem == NULL)
{
free(node);
return (NULL);
}
ft_memset(node->mem, '0', LSTBUF_SIZE);
node->mem_size = LSTBUF_SIZE;
node->next = NULL;
node->prev = NULL;
return (node);
}