summaryrefslogtreecommitdiffstats
path: root/libft/src/ft_printf_get_flags.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_printf_get_flags.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_printf_get_flags.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libft/src/ft_printf_get_flags.c b/libft/src/ft_printf_get_flags.c
index ca49206..e6ba0de 100644
--- a/libft/src/ft_printf_get_flags.c
+++ b/libft/src/ft_printf_get_flags.c
@@ -21,8 +21,7 @@
** Also puts actual conv into pflist->actconv
*/
-char
- *ft_printf_get_flags(const char *format, int pos, t_printflist *pflist)
+char *ft_printf_get_flags(const char *format, int pos, t_printflist *pflist)
{
int i;
char *nstr;
@@ -32,7 +31,7 @@ char
while (!ft_ischarset(FT_PRINTF_CONV_CHARSET, *(format + pos + i + 1))
&& *(format + pos + i + 1))
i++;
- if (!(fullflag = (char*)malloc((i + 1) * sizeof(char))))
+ if ((fullflag = (char*)malloc((i + 1) * sizeof(char))) == NULL)
return (NULL);
ft_memcpy(fullflag, nstr = ft_substr(format, pos + 1, i), i);
ft_memdel((void**)&nstr);