diff options
Diffstat (limited to 'libft')
-rw-r--r-- | libft/src/ft_substr.c | 7 |
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); } |