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_int.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'convert_int.c') diff --git a/convert_int.c b/convert_int.c index 34336d0..0f4d7d1 100644 --- a/convert_int.c +++ b/convert_int.c @@ -6,7 +6,7 @@ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/10/30 23:29:53 by cacharle #+# #+# */ -/* Updated: 2019/10/30 23:32:21 by cacharle ### ########.fr */ +/* Updated: 2019/11/04 01:26:38 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -22,7 +22,11 @@ char *convert_int(va_list ap, t_pformat *pformat) long long int n; char *str; - if (pformat->flags & FLAG_LONG) + if (pformat->flags & FLAG_SHORT) + n = (short)va_arg(ap, int); + else if (pformat->flags & FLAG_SHORT_SHORT) + n = (signed char)va_arg(ap, int); + else if (pformat->flags & FLAG_LONG) n = va_arg(ap, long int); else if (pformat->flags & FLAG_LONG_LONG) n = va_arg(ap, long long int); -- cgit