aboutsummaryrefslogtreecommitdiff
path: root/convert_written.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_written.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_written.c')
-rw-r--r--convert_written.c14
1 files changed, 12 insertions, 2 deletions
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 <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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);
}