summaryrefslogtreecommitdiffstats
path: root/libft/src/ft_substr.c
diff options
context:
space:
mode:
authorsalad <fmoenne-@student.le-101.fr>2020-04-27 18:11:59 +0200
committersalad <fmoenne-@student.le-101.fr>2020-04-27 18:11:59 +0200
commitf3c766105a7dc8a3f1791374c41542ea833c53ce (patch)
treeba1ecd86edf60952a85528c2e4184c7ac9ed226e /libft/src/ft_substr.c
parentfecho full buffered, quotes bav (diff)
parentFinished and normed type (diff)
download42-minishell-f3c766105a7dc8a3f1791374c41542ea833c53ce.tar.gz
42-minishell-f3c766105a7dc8a3f1791374c41542ea833c53ce.tar.bz2
42-minishell-f3c766105a7dc8a3f1791374c41542ea833c53ce.tar.xz
42-minishell-f3c766105a7dc8a3f1791374c41542ea833c53ce.tar.zst
42-minishell-f3c766105a7dc8a3f1791374c41542ea833c53ce.zip
merge master into fmoenne
Diffstat (limited to 'libft/src/ft_substr.c')
-rw-r--r--libft/src/ft_substr.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/libft/src/ft_substr.c b/libft/src/ft_substr.c
index 6d94368..947a305 100644
--- a/libft/src/ft_substr.c
+++ b/libft/src/ft_substr.c
@@ -23,11 +23,6 @@ char
i = 0;
if (!(nstr = (char*)malloc((len + 1) * sizeof(char))))
return (NULL);
- while (s[start + i] && i < len)
- {
- nstr[i] = s[start + i];
- i++;
- }
- nstr[i] = '\0';
+ ft_strlcpy(nstr, s + start, len + 1);
return (nstr);
}