Define SPECIFIERS macro and use it everyhere.

This commit is contained in:
gbaconni
2022-04-29 09:12:07 +02:00
parent 38021fb98f
commit 5734b6b29b
6 changed files with 16 additions and 14 deletions

View File

@@ -6,7 +6,7 @@
/* By: gbaconni@student.42lausanne.ch +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/01/20 11:55:02 by gbaconni #+# #+# */
/* Updated: 2022/04/29 08:42:35 by gbaconni ### lausanne.ch */
/* Updated: 2022/04/29 09:09:08 by gbaconni ### lausanne.ch */
/* */
/* ************************************************************************** */
@@ -44,7 +44,7 @@ int ft_vprintf_decimal(const char *format, va_list ap)
{
if (ft_isdigit(*f))
precision = precision * 10 + *f - '0';
if (ft_strchr("cspdiuxX%", *f) != NULL)
if (ft_strchr(SPECIFIERS, *f) != NULL)
break ;
f++;
}
@@ -52,7 +52,7 @@ int ft_vprintf_decimal(const char *format, va_list ap)
if (precision > 0)
{
len = precision - ft_strlen(s);
while (len --> 0)
while (len-- > 0)
{
if (flags & F_ZERO)
ret += ft_putchar('0');