From 9af2885d872de9c60b11159efe0685738031096d Mon Sep 17 00:00:00 2001 From: Charles Date: Fri, 14 Feb 2020 03:46:08 +0100 Subject: Added documentation for all functions and refactored ft_strjoin_free -> ft_strjoinf --- src/str/ft_substr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/str/ft_substr.c') 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 +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* 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); -- cgit