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 --- printer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'printer.c') diff --git a/printer.c b/printer.c index cfbf429..f7955fe 100644 --- a/printer.c +++ b/printer.c @@ -6,7 +6,7 @@ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* 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("")); -- cgit