From 89c80e9bdb4b9dce0c85f4c7bf4316f5e320bd59 Mon Sep 17 00:00:00 2001 From: Etienne Rey-bethbeder Date: Tue, 21 Feb 2023 22:26:45 +0100 Subject: [PATCH] .......................prout --- builtins/echo.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/builtins/echo.c b/builtins/echo.c index 1ef2f22..d88fc9d 100644 --- a/builtins/echo.c +++ b/builtins/echo.c @@ -6,7 +6,7 @@ /* By: erey-bet +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/02/17 13:09:08 by erey-bet #+# #+# */ -/* Updated: 2023/02/21 22:09:55 by erey-bet ### ########.fr */ +/* Updated: 2023/02/21 22:24:51 by erey-bet ### ########.fr */ /* */ /* ************************************************************************** */ @@ -64,7 +64,8 @@ char *conca(char **strs) while (strs[++i] != NULL) { ft_strlcat(str, strs[i], ft_strlen(str) + ft_strlen(strs[i]) + 2); - str[ft_strlen(str)] = ' '; + if (strs[i + 1] != NULL) + str[ft_strlen(str)] = ' '; } str[ft_strlen(str)] = '\0'; return (str);