From d744e75aea3145927a4e725eb95496499dc54630 Mon Sep 17 00:00:00 2001 From: Charles Date: Sun, 13 Oct 2019 13:55:07 +0200 Subject: Added precision and min field width wildcard --- parse.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'parse.c') diff --git a/parse.c b/parse.c index c61fb5c..3d1fb00 100644 --- a/parse.c +++ b/parse.c @@ -66,6 +66,12 @@ t_pformat *parse_conversion(char *conversion) pformat->left_adjusted = *start == '-'; start++; } + pformat->min_field_width_wildcard = FALSE; + if (*start == '*') + { + pformat->min_field_width_wildcard = TRUE; + start++; + } if (ft_isdigit(*start)) { pformat->min_field_width = ft_atoi(start); @@ -75,12 +81,20 @@ t_pformat *parse_conversion(char *conversion) else pformat->min_field_width = -1; pformat->precision = -1; + pformat->precision_wildcard = FALSE; if (*start == '.') { start++; - pformat->precision = ft_atoi(start); - while (ft_isdigit(*start)) - start++; + /* printf("\n%s\n", start); */ + if (*start == '*') + pformat->precision_wildcard = TRUE; + else + { + pformat->precision_wildcard = FALSE; + pformat->precision = ft_atoi(start); + while (ft_isdigit(*start)) + start++; + } } return (pformat); } -- cgit