aboutsummaryrefslogtreecommitdiff
path: root/src/str/ft_substr.c
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-02-14 03:46:08 +0100
committerCharles <sircharlesaze@gmail.com>2020-02-14 03:46:08 +0100
commit9af2885d872de9c60b11159efe0685738031096d (patch)
tree813183555eae5d0a84f11d7be3178d07b3d5f9d9 /src/str/ft_substr.c
parentadbcf69ed50ea3896d4bbe863ea5d214ae5a0299 (diff)
downloadlibft-9af2885d872de9c60b11159efe0685738031096d.tar.gz
libft-9af2885d872de9c60b11159efe0685738031096d.tar.bz2
libft-9af2885d872de9c60b11159efe0685738031096d.zip
Added documentation for all functions and refactored ft_strjoin_free -> ft_strjoinf
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);