summaryrefslogtreecommitdiffstats
path: root/libft/src/ft_strsubst.c
diff options
context:
space:
mode:
authorsalad <fmoenne-@student.le-101.fr>2020-10-26 13:42:56 +0100
committersalad <fmoenne-@student.le-101.fr>2020-10-26 13:42:56 +0100
commit0277ddfac754ab4ad5bdd2b692e31a717efbe569 (patch)
tree49d7c5fd3a12248af85e2c3a3254bc1538ae5775 /libft/src/ft_strsubst.c
parentreqdy for MERGE (diff)
parentTODO update (diff)
download42-minishell-0277ddfac754ab4ad5bdd2b692e31a717efbe569.tar.gz
42-minishell-0277ddfac754ab4ad5bdd2b692e31a717efbe569.tar.bz2
42-minishell-0277ddfac754ab4ad5bdd2b692e31a717efbe569.tar.xz
42-minishell-0277ddfac754ab4ad5bdd2b692e31a717efbe569.tar.zst
42-minishell-0277ddfac754ab4ad5bdd2b692e31a717efbe569.zip
merge wif master
Diffstat (limited to 'libft/src/ft_strsubst.c')
-rw-r--r--libft/src/ft_strsubst.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libft/src/ft_strsubst.c b/libft/src/ft_strsubst.c
index 57e0ac8..3c5c643 100644
--- a/libft/src/ft_strsubst.c
+++ b/libft/src/ft_strsubst.c
@@ -20,10 +20,10 @@ char
char *nstr;
char *ptr;
- if (!(ptr = ft_strnstr(str, pattern, ft_strlen(str))))
+ if ((ptr = ft_strnstr(str, pattern, ft_strlen(str))) == NULL)
return (NULL);
nlen = ft_strlen(str) - ft_strlen(pattern) + ft_strlen(subst);
- if (!(nstr = (char*)malloc((nlen + 1) * sizeof(char))))
+ if ((nstr = (char*)malloc((nlen + 1) * sizeof(char))) == NULL)
return (NULL);
ft_memcpy(nstr, str, ptr - str);
ft_memcpy(nstr + (ptr - str), subst, ft_strlen(subst));