diff options
Diffstat (limited to 'convert_int.c')
| -rw-r--r-- | convert_int.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/convert_int.c b/convert_int.c index 8bc0b1a..ebc360a 100644 --- a/convert_int.c +++ b/convert_int.c @@ -26,14 +26,18 @@ char *convert_int(va_list ap, t_pformat *pformat) str = handle_precision(pformat, str); if (pformat->flags & FLAG_ZERO_PADDING) { - if (is_neg || pformat->flags & FLAG_SIGNED || pformat->flags & FLAG_SPACE) + if (is_neg || pformat->flags & (FLAG_SIGNED | FLAG_SPACE)) pformat->min_width--; /* pformat->min_width--; */ str = handle_padding(pformat, str); } + /* str[ft_strlen(str)] = 0; */ if (is_neg) + { tmp = ft_strjoin("-", str); - else if (pformat->flags & FLAG_SIGNED || pformat->flags & FLAG_SPACE) + /* printf("%s\n", str); */ + } + else if (pformat->flags & (FLAG_SIGNED | FLAG_SPACE)) tmp = ft_strjoin(pformat->flags & FLAG_SPACE ? " " : "+", str); else tmp = ft_strdup(str); |
