From 6313e7ff4caeaa9f3aca97168f894c8316f8e24a Mon Sep 17 00:00:00 2001 From: M600 Date: Tue, 21 Mar 2017 16:14:01 +0100 Subject: [PATCH] Replaced malloc to ft_malloc for completion --- 42sh/src/completion/c_find_env.c | 2 +- 42sh/src/completion/c_init.c | 2 +- 42sh/src/completion/c_parser.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/42sh/src/completion/c_find_env.c b/42sh/src/completion/c_find_env.c index 02c1d296..3d36ea24 100644 --- a/42sh/src/completion/c_find_env.c +++ b/42sh/src/completion/c_find_env.c @@ -20,7 +20,7 @@ static int c_addnode(t_comp *c, char *value) { t_clst *tmp; - if (!(tmp = (t_clst *)malloc(sizeof(t_clst)))) + if (!(tmp = (t_clst *)ft_malloc(sizeof(t_clst)))) return (-1); tmp->name = value; tmp->len = ft_strlen(tmp->name); diff --git a/42sh/src/completion/c_init.c b/42sh/src/completion/c_init.c index 93962e51..3cfd34ca 100644 --- a/42sh/src/completion/c_init.c +++ b/42sh/src/completion/c_init.c @@ -82,7 +82,7 @@ void c_init(t_data *s, long int input) { int len_trail; - if (!(s->comp = (t_comp *)malloc((sizeof(t_comp))))) + if (!(s->comp = (t_comp *)ft_malloc((sizeof(t_comp))))) return ; c_init_base(s->comp); s->comp->rcmd = c_trimmer(s->line.input, s->line.pos, s->line.pos); diff --git a/42sh/src/completion/c_parser.c b/42sh/src/completion/c_parser.c index c59e1ad4..49721404 100644 --- a/42sh/src/completion/c_parser.c +++ b/42sh/src/completion/c_parser.c @@ -52,7 +52,7 @@ static int c_storing(t_comp *c, char *value, unsigned char type) return (0); if (c->match && ft_strnequ(c->match, value, ft_strlen(c->match)) != 1) return (0); - if (!(tmp = (t_clst *)malloc(sizeof(t_clst)))) + if (!(tmp = (t_clst *)ft_malloc(sizeof(t_clst)))) return (-1); tmp->name = ft_strdup(value); tmp->len = ft_strlen(tmp->name);