From 38bbcb10980c5ad1692aadd574e911e9c551cae9 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Sun, 26 Apr 2020 21:05:11 +0200 Subject: Better subst --- libft/src/ft_strsubst.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libft') diff --git a/libft/src/ft_strsubst.c b/libft/src/ft_strsubst.c index dd89917..57e0ac8 100644 --- a/libft/src/ft_strsubst.c +++ b/libft/src/ft_strsubst.c @@ -30,7 +30,7 @@ char ft_memcpy(nstr + (ptr - str + ft_strlen(subst)), str + (ptr - str + ft_strlen(pattern)), ft_strlen(str + (ptr - str + ft_strlen(pattern)))); - nstr[nlen + 1] = '\0'; + nstr[nlen] = '\0'; ft_memdel((void*)&str); return (nstr); } -- cgit v1.2.3