diff options
Diffstat (limited to '')
| -rw-r--r-- | src/s_line.c | 7 | ||||
| -rw-r--r-- | src/s_struct.h | 2 | 
2 files changed, 5 insertions, 4 deletions
| diff --git a/src/s_line.c b/src/s_line.c index b198fff..c6e2e0b 100644 --- a/src/s_line.c +++ b/src/s_line.c @@ -59,6 +59,7 @@ void  	while (tmp != NULL)  	{  		renext = tmp->next; +		ft_memdel((void*)&tmp->lblock);  		ft_memdel((void*)&tmp);  		tmp = renext;  	} @@ -72,7 +73,7 @@ t_line_block  	if ((link = (t_line_block*)malloc(sizeof(t_line_block))) == NULL)  		return (NULL); -	link->lblock[0] = C_NUL; +	link->lblock = NULL;  	link->nextif = nextif;  	link->next = NULL;  	if (word == NULL) @@ -80,9 +81,9 @@ t_line_block  		link->next = NULL;  		return (link);  	} -	else +	else if ((link->lblock = ft_strdup(word)) == NULL)  	{ -		ft_strlcpy(link->lblock, word, 4096); +		return (NULL);  	}  	return (link);  } diff --git a/src/s_struct.h b/src/s_struct.h index 2734618..31c80fc 100644 --- a/src/s_struct.h +++ b/src/s_struct.h @@ -60,7 +60,7 @@ struct					s_lpipes  typedef struct			s_line_block  { -	char				lblock[ARG_MAX]; +	char				*lblock;  	uint8_t				nextif;  	struct s_line_block	*next;  }						t_line_block; | 
