diff options
Diffstat (limited to 'convert_hex_low.c')
| -rw-r--r-- | convert_hex_low.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/convert_hex_low.c b/convert_hex_low.c new file mode 100644 index 0000000..39cc188 --- /dev/null +++ b/convert_hex_low.c @@ -0,0 +1,17 @@ +#include <stdarg.h> +#include "header.h" + +char *convert_hex_low(va_list ap, t_pformat *pformat) +{ + unsigned int n = va_arg(ap, unsigned int); + char *str = ITOA_HEX_LOW(n); + str = handle_precision(pformat, str); + if (pformat->flags & FLAG_ALTERNATE && n != 0) + { + char *tmp = ft_strjoin("0x", str); + free(str); + str = tmp; + } + str = handle_padding(pformat, str); + return (str); +} |
