summaryrefslogtreecommitdiffstats
path: root/libft/src/ft_substr.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-04-27 15:39:14 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-04-27 15:39:14 +0200
commitc8e857173d2879e9a55085384fe5978370a11c57 (patch)
treec5f351630003ce061018427f746cf3c0175f0bcc /libft/src/ft_substr.c
parent'msh ~> ;' bug fix (diff)
download42-minishell-c8e857173d2879e9a55085384fe5978370a11c57.tar.gz
42-minishell-c8e857173d2879e9a55085384fe5978370a11c57.tar.bz2
42-minishell-c8e857173d2879e9a55085384fe5978370a11c57.tar.xz
42-minishell-c8e857173d2879e9a55085384fe5978370a11c57.tar.zst
42-minishell-c8e857173d2879e9a55085384fe5978370a11c57.zip
Variables fixed
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);
}