aboutsummaryrefslogtreecommitdiff
path: root/convert_int.c
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2019-11-04 01:34:37 +0100
committerCharles <sircharlesaze@gmail.com>2019-11-04 01:34:37 +0100
commiteca117f28afac2ee258d9e9454ff63c6dec5b58f (patch)
treee0920d77db27902ded907287ea5bbd8e4ec801fb /convert_int.c
parent0f6cd15b0c7ce2d4d0154ae027985ed640cd543f (diff)
downloadft_printf-eca117f28afac2ee258d9e9454ff63c6dec5b58f.tar.gz
ft_printf-eca117f28afac2ee258d9e9454ff63c6dec5b58f.tar.bz2
ft_printf-eca117f28afac2ee258d9e9454ff63c6dec5b58f.zip
int type length specifier, edge case with zero padding and invalid wildcard precision
Diffstat (limited to 'convert_int.c')
-rw-r--r--convert_int.c8
1 files changed, 6 insertions, 2 deletions
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 <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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);