From 57a3b88e09a014c76aba338d6eca04be8bcb85bc Mon Sep 17 00:00:00 2001 From: Charles Date: Sun, 13 Oct 2019 10:45:02 +0200 Subject: Min width, zero filled, left adjusted Conversion of arg in a string, the padding is computed based on the length of the string. --- parse.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'parse.c') diff --git a/parse.c b/parse.c index 4ca73bd..b1d40a1 100644 --- a/parse.c +++ b/parse.c @@ -56,6 +56,8 @@ t_pformat *parse_conversion(char *conversion) if ((conversion = parse_arg_position(conversion, pformat)) == NULL) return (NULL); start = conversion; + pformat->zero_padding = FALSE; + pformat->left_adjusted = FALSE; while (IS_STANDALONE_FLAG(*start)) { if (!pformat->zero_padding) @@ -75,7 +77,7 @@ char *parse_arg_position(char *conversion, t_pformat *pformat) { if (strrchr_index(conversion, '$') != -1) { - if ((pformat->arg_position = ft_atoi(conversion)) == 0) + if ((pformat->ap_index = ft_atoi(conversion)) == 0) { free(pformat); return (NULL); @@ -85,6 +87,6 @@ char *parse_arg_position(char *conversion, t_pformat *pformat) conversion++; } else - pformat->arg_position = -1; + pformat->ap_index = -1; return (conversion); } -- cgit