diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-09-29 19:50:20 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-09-29 19:50:20 +0200 |
commit | 9a915b797a80c2a776027b1fcc37f1e7b8ab1b24 (patch) | |
tree | 99a0fdb289fa4ec03e8b5cc179d6c6d073f6a84a /libft/src/ft_strsubst_s.c | |
parent | Fix (diff) | |
download | 42-minishell-9a915b797a80c2a776027b1fcc37f1e7b8ab1b24.tar.gz 42-minishell-9a915b797a80c2a776027b1fcc37f1e7b8ab1b24.tar.bz2 42-minishell-9a915b797a80c2a776027b1fcc37f1e7b8ab1b24.tar.xz 42-minishell-9a915b797a80c2a776027b1fcc37f1e7b8ab1b24.tar.zst 42-minishell-9a915b797a80c2a776027b1fcc37f1e7b8ab1b24.zip |
Update
Diffstat (limited to '')
-rw-r--r-- | libft/src/ft_strsubst_s.c | 8 |
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); } |