aboutsummaryrefslogtreecommitdiff
path: root/src/str/ft_substr.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/str/ft_substr.c')
-rw-r--r--src/str/ft_substr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/str/ft_substr.c b/src/str/ft_substr.c
index 84d6c58..ad9c706 100644
--- a/src/str/ft_substr.c
+++ b/src/str/ft_substr.c
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/10/17 08:28:49 by cacharle #+# #+# */
-/* Updated: 2019/11/20 03:57:58 by cacharle ### ########.fr */
+/* Updated: 2020/02/14 03:44:42 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
@@ -18,7 +18,7 @@ char *ft_substr(char const *s, unsigned int start, size_t len)
if (s == NULL)
return (NULL);
- if ((sub = ft_strnew(len)) == NULL)
+ if ((sub = (char*)malloc(sizeof(char) * (len + 1))) == NULL)
return (NULL);
if (start > ft_strlen(s))
return (sub);