summaryrefslogtreecommitdiffstats
path: root/libft/src/ft_nstr.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-09-29 19:18:30 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-09-29 19:18:30 +0200
commit4ede84d4ab98c75ed8655607fe64c205b79ed986 (patch)
tree6f9d5113400faf13a778de0f09c0203c7939b93f /libft/src/ft_nstr.c
parentNorm update (diff)
download42-minishell-4ede84d4ab98c75ed8655607fe64c205b79ed986.tar.gz
42-minishell-4ede84d4ab98c75ed8655607fe64c205b79ed986.tar.bz2
42-minishell-4ede84d4ab98c75ed8655607fe64c205b79ed986.tar.xz
42-minishell-4ede84d4ab98c75ed8655607fe64c205b79ed986.tar.zst
42-minishell-4ede84d4ab98c75ed8655607fe64c205b79ed986.zip
libft norm in progress
Diffstat (limited to '')
-rw-r--r--libft/src/ft_nstr.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/libft/src/ft_nstr.c b/libft/src/ft_nstr.c
index 7b09053..823e1b8 100644
--- a/libft/src/ft_nstr.c
+++ b/libft/src/ft_nstr.c
@@ -13,15 +13,14 @@
#include <stdlib.h>
#include <stddef.h>
-char
- *ft_nstr(size_t size)
+char *ft_nstr(size_t size)
{
- char *str;
- size_t i;
+ char *str;
+ size_t i;
i = 0;
size += 1;
- if (!(str = (char*)malloc((size) * sizeof(char))))
+ if ((str = (char*)malloc((size) * sizeof(char))) == NULL)
return (NULL);
while (i < size)
{