summaryrefslogtreecommitdiffstats
path: root/src/s_line.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-09-09 18:40:11 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-09-09 18:40:11 +0200
commit44cd349d69a11fec6c698ec45a59e373cad56c2e (patch)
tree1003facb93ed6649d0de6b89a544fa4c6346d334 /src/s_line.c
parentThe more memory the better LOL (diff)
download42-minishell-44cd349d69a11fec6c698ec45a59e373cad56c2e.tar.gz
42-minishell-44cd349d69a11fec6c698ec45a59e373cad56c2e.tar.bz2
42-minishell-44cd349d69a11fec6c698ec45a59e373cad56c2e.tar.xz
42-minishell-44cd349d69a11fec6c698ec45a59e373cad56c2e.tar.zst
42-minishell-44cd349d69a11fec6c698ec45a59e373cad56c2e.zip
qwe
Diffstat (limited to '')
-rw-r--r--src/s_line.c7
1 files changed, 4 insertions, 3 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);
}