summaryrefslogtreecommitdiffstats
path: root/src/m_loop_counter.c
diff options
context:
space:
mode:
authorjoe <rbousset@42lyon.fr>2020-12-04 18:23:58 +0100
committerjoe <rbousset@42lyon.fr>2020-12-04 18:23:58 +0100
commit9c54925787fe0a788e4014baf202c2ffc37cb4f4 (patch)
tree94ad68ecf4c3ad5ab73fa9c0f7fb818b0974ccfa /src/m_loop_counter.c
parentGood now (diff)
download42-minishell-9c54925787fe0a788e4014baf202c2ffc37cb4f4.tar.gz
42-minishell-9c54925787fe0a788e4014baf202c2ffc37cb4f4.tar.bz2
42-minishell-9c54925787fe0a788e4014baf202c2ffc37cb4f4.tar.xz
42-minishell-9c54925787fe0a788e4014baf202c2ffc37cb4f4.tar.zst
42-minishell-9c54925787fe0a788e4014baf202c2ffc37cb4f4.zip
fix
Diffstat (limited to 'src/m_loop_counter.c')
-rw-r--r--src/m_loop_counter.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/m_loop_counter.c b/src/m_loop_counter.c
index d1d4dcf..936fa7c 100644
--- a/src/m_loop_counter.c
+++ b/src/m_loop_counter.c
@@ -28,15 +28,12 @@ char *m_counter_line_backslash(int fd,
c_gnl(fd, &counter_line, psx, msh);
else
get_next_line(fd, &counter_line);
- if (counter_line[0] != C_NUL)
- {
- l = ft_nrealloc(l,
- ft_strlen(l) + 1,
- ft_strlen(l) + ft_strlen(counter_line));
- ft_memcpy(l + ft_strlen(l) - 1,
- counter_line,
- ft_strlen(counter_line) + 1);
- }
+ l = ft_nrealloc(l,
+ ft_strlen(l) + 1,
+ ft_strlen(l) + ft_strlen(counter_line));
+ ft_memcpy(l + ft_strlen(l) - 1,
+ counter_line,
+ ft_strlen(counter_line) + 1);
ft_memdel((void*)&counter_line);
return (l);
}