diff options
| author | Charles <sircharlesaze@gmail.com> | 2019-10-30 18:07:21 +0100 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2019-10-30 18:07:21 +0100 |
| commit | 22f334a19cabebf10727d7894102946ba23d0e37 (patch) | |
| tree | fd323ff0dbb8fc06a00c8c26dfc6fbd3b5ae0910 /convert_hex_up.c | |
| parent | 001786c8ec464b1ae3e6321acfd984227cb1bbee (diff) | |
| download | ft_printf-22f334a19cabebf10727d7894102946ba23d0e37.tar.gz ft_printf-22f334a19cabebf10727d7894102946ba23d0e37.tar.bz2 ft_printf-22f334a19cabebf10727d7894102946ba23d0e37.zip | |
Fixed %d segfault, merge hex_* in hex, fixed c = 0
Diffstat (limited to 'convert_hex_up.c')
| -rw-r--r-- | convert_hex_up.c | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/convert_hex_up.c b/convert_hex_up.c deleted file mode 100644 index eba1226..0000000 --- a/convert_hex_up.c +++ /dev/null @@ -1,37 +0,0 @@ -#include <stdarg.h> -#include <stdlib.h> -#include "header.h" - -char *convert_hex_up(va_list ap, t_pformat *pformat) -{ - long long unsigned int n; - - if (pformat->flags & FLAG_SHORT) - n = va_arg(ap, int); - else if (pformat->flags & FLAG_SHORT_SHORT) - n = va_arg(ap, int); - else if (pformat->flags & FLAG_LONG) - n = va_arg(ap, long unsigned int); - else if (pformat->flags & FLAG_LONG_LONG) - n = va_arg(ap, long long unsigned int); - else - n = va_arg(ap, unsigned int); - - char *str = ITOA_HEX_UP(n); - str = handle_precision(pformat, str); - if (pformat->flags & FLAG_ZERO_PADDING) - { - if (pformat->flags & FLAG_ALTERNATE && n != 0) - pformat->min_width -= 2; - str = handle_padding(pformat, str); - } - if (pformat->flags & FLAG_ALTERNATE && n != 0) - { - char *tmp = ft_strjoin("0X", str); - free(str); - str = tmp; - } - if (!(pformat->flags & FLAG_ZERO_PADDING)) - str = handle_padding(pformat, str); - return (str); -} |
