summaryrefslogtreecommitdiffstats
path: root/libft/src/ft_strsubst_s.c
diff options
context:
space:
mode:
Diffstat (limited to 'libft/src/ft_strsubst_s.c')
-rw-r--r--libft/src/ft_strsubst_s.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libft/src/ft_strsubst_s.c b/libft/src/ft_strsubst_s.c
index ea61610..9e43907 100644
--- a/libft/src/ft_strsubst_s.c
+++ b/libft/src/ft_strsubst_s.c
@@ -14,8 +14,7 @@
#include <stdint.h>
#include <stdlib.h>
-int8_t
- ft_strsubst_s(char *str, const char *pattern, const char *subst)
+int8_t ft_strsubst_s(char *str, const char *pattern, const char *subst)
{
char *ptr;
@@ -23,9 +22,10 @@ int8_t
return (1);
(void)ft_memmove(str + ((ptr - str) + ft_strlen(subst)),
str + ((ptr - str) + ft_strlen(pattern)),
- ft_strlen(str + ((ptr - str) + ft_strlen(pattern))) + 1);
+ (ft_strlen(str + ((ptr - str) + ft_strlen(pattern))) + 1)
+ * sizeof(char));
(void)ft_memmove(str + (ptr - str),
subst,
- ft_strlen(subst));
+ ft_strlen(subst) * sizeof(char));
return (0);
}