From c8e857173d2879e9a55085384fe5978370a11c57 Mon Sep 17 00:00:00 2001
From: JozanLeClerc <bousset.rudy@gmail.com>
Date: Mon, 27 Apr 2020 15:39:14 +0200
Subject: Variables fixed

---
 libft/src/ft_substr.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

(limited to 'libft/src')

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);
 }
-- 
cgit v1.2.3