From eca117f28afac2ee258d9e9454ff63c6dec5b58f Mon Sep 17 00:00:00 2001 From: Charles Date: Mon, 4 Nov 2019 01:34:37 +0100 Subject: int type length specifier, edge case with zero padding and invalid wildcard precision --- convert_written.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'convert_written.c') diff --git a/convert_written.c b/convert_written.c index f2cdc2b..7564d35 100644 --- a/convert_written.c +++ b/convert_written.c @@ -6,7 +6,7 @@ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/10/30 23:38:28 by cacharle #+# #+# */ -/* Updated: 2019/10/30 23:59:05 by cacharle ### ########.fr */ +/* Updated: 2019/11/04 00:21:16 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -15,6 +15,16 @@ char *convert_written(va_list ap, t_pformat *pformat) { - pformat->written = va_arg(ap, int*); + + if (pformat->flags & FLAG_SHORT) + pformat->written = va_arg(ap, signed char*); + if (pformat->flags & FLAG_SHORT_SHORT) + pformat->written = va_arg(ap, short*); + if (pformat->flags & FLAG_LONG) + pformat->written = va_arg(ap, long int*); + if (pformat->flags & FLAG_LONG_LONG) + pformat->written = va_arg(ap, long long int*); + else + pformat->written = va_arg(ap, int*); return (NULL); } -- cgit