diff options
| author | Charles <sircharlesaze@gmail.com> | 2019-10-13 10:45:02 +0200 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2019-10-13 10:45:02 +0200 |
| commit | 57a3b88e09a014c76aba338d6eca04be8bcb85bc (patch) | |
| tree | a72cee7b779881d0a905940bfbae9ffcd53510e5 /parse.c | |
| parent | 1531206a1e5545824d76bf7a73249d6be9237c67 (diff) | |
| download | ft_printf-57a3b88e09a014c76aba338d6eca04be8bcb85bc.tar.gz ft_printf-57a3b88e09a014c76aba338d6eca04be8bcb85bc.tar.bz2 ft_printf-57a3b88e09a014c76aba338d6eca04be8bcb85bc.zip | |
Min width, zero filled, left adjusted
Conversion of arg in a string, the padding is computed based on the
length of the string.
Diffstat (limited to 'parse.c')
| -rw-r--r-- | parse.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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); } |
