diff options
Diffstat (limited to 'libft')
-rw-r--r-- | libft/src/ft_nrealloc.c | 4 | ||||
-rw-r--r-- | libft/src/ft_strsubst.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/libft/src/ft_nrealloc.c b/libft/src/ft_nrealloc.c index 82975d1..6b42380 100644 --- a/libft/src/ft_nrealloc.c +++ b/libft/src/ft_nrealloc.c @@ -21,7 +21,7 @@ void if (!ptr) { - if (!(ptr = malloc(newsize))) + if ((ptr = malloc(newsize)) == NULL) return (NULL); return (ptr); } @@ -30,7 +30,7 @@ void ft_memdel((void*)&ptr); return (NULL); } - if (!(nptr = malloc(newsize))) + if ((nptr = malloc(newsize)) == NULL) return (ptr); ft_memcpy(nptr, ptr, oldsize); ft_memdel((void*)&ptr); 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)); |