summaryrefslogtreecommitdiffstats
path: root/libft
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-04-21 19:41:43 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-04-21 19:41:43 +0200
commit1e4fdf3068b1c9142793fae53a0c75a25b44d1cb (patch)
tree5d9a4bfa750ae231cb412c75b6d55e7dd1ea98e2 /libft
parentUpdated todolist (diff)
download42-minishell-1e4fdf3068b1c9142793fae53a0c75a25b44d1cb.tar.gz
42-minishell-1e4fdf3068b1c9142793fae53a0c75a25b44d1cb.tar.bz2
42-minishell-1e4fdf3068b1c9142793fae53a0c75a25b44d1cb.tar.xz
42-minishell-1e4fdf3068b1c9142793fae53a0c75a25b44d1cb.tar.zst
42-minishell-1e4fdf3068b1c9142793fae53a0c75a25b44d1cb.zip
Cool
Diffstat (limited to 'libft')
-rw-r--r--libft/src/get_next_line.c6
-rw-r--r--libft/src/get_next_line_utils.c16
2 files changed, 11 insertions, 11 deletions
diff --git a/libft/src/get_next_line.c b/libft/src/get_next_line.c
index ae64125..2b2ba80 100644
--- a/libft/src/get_next_line.c
+++ b/libft/src/get_next_line.c
@@ -36,7 +36,7 @@ static char
while (++j < size2)
dst[i + j] = s2[j];
dst[i + j] = '\0';
- ft_memdel((void**)&s1);
+ ft_memdel((void*)&s1);
return (dst);
}
@@ -56,7 +56,7 @@ static int
{
*line = ft_strjoin_gnl(*line, buf);
if ((size = read(fd, buf, BUFFER_SIZE)) == -1)
- ft_memdel((void**)&buf);
+ ft_memdel((void*)&buf);
if (size == -1)
return (-1);
buf[size] = 0;
@@ -64,7 +64,7 @@ static int
*line = ft_strjoin_gnl(*line, buf);
if (end)
curr->rest = ft_swap_gnl(end + 1, curr->rest);
- ft_memdel((void**)&buf);
+ ft_memdel((void*)&buf);
if (!end)
return (0);
return (size);
diff --git a/libft/src/get_next_line_utils.c b/libft/src/get_next_line_utils.c
index 42d5d3a..5181808 100644
--- a/libft/src/get_next_line_utils.c
+++ b/libft/src/get_next_line_utils.c
@@ -37,8 +37,8 @@ int
if (prev->fd == fd)
{
scout = prev->next;
- ft_memdel((void**)&prev->rest);
- ft_memdel((void**)&prev);
+ ft_memdel((void*)&prev->rest);
+ ft_memdel((void*)&prev);
*list = scout;
return (0);
}
@@ -49,8 +49,8 @@ int
scout = scout->next;
}
prev->next = scout->next;
- ft_memdel((void**)&scout->rest);
- ft_memdel((void**)&scout);
+ ft_memdel((void*)&scout->rest);
+ ft_memdel((void*)&scout);
return (0);
}
@@ -60,7 +60,7 @@ t_gnl
t_gnl *curr;
t_gnl *new;
- if (!(new = malloc(sizeof(*new))))
+ if (!(new = (t_gnl*)malloc(sizeof(t_gnl))))
return (NULL);
new->fd = fd;
new->rest = 0;
@@ -78,7 +78,7 @@ t_gnl
if (curr->next == NULL)
return (curr->next = new);
}
- ft_memdel((void**)&new);
+ ft_memdel((void*)&new);
return (curr);
}
@@ -104,7 +104,7 @@ char
char *dst;
int i;
- if (!(dst = malloc(ft_strlen_gnl(s1, 0) + 1)))
+ if (!(dst = (char*)malloc((ft_strlen_gnl(s1, 0) + 1) * sizeof(char))))
return (NULL);
i = 0;
while (s1[i])
@@ -113,6 +113,6 @@ char
i++;
}
dst[i] = 0;
- ft_memdel((void**)&free_ft);
+ ft_memdel((void*)&free_ft);
return (dst);
}