aboutsummaryrefslogtreecommitdiff
path: root/printer.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 /printer.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 'printer.c')
-rw-r--r--printer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/printer.c b/printer.c
index cfbf429..f7955fe 100644
--- a/printer.c
+++ b/printer.c
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/10/28 23:19:24 by cacharle #+# #+# */
-/* Updated: 2019/10/30 23:56:21 by cacharle ### ########.fr */
+/* Updated: 2019/11/04 01:31:49 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
@@ -96,6 +96,8 @@ char *handle_precision(t_pformat *pformat, char *str)
int len;
char *tmp;
+ if (ft_strchr("diuxX", pformat->type) && pformat->precision > 0)
+ pformat->flags &= ~FLAG_ZERO_PADDING;
len = ft_strlen(str);
if (pformat->precision == 0 && str[0] == '0')
return (ft_strdup(""));