aboutsummaryrefslogtreecommitdiff
path: root/convert_hex_low.c
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2019-10-30 23:35:40 +0100
committerCharles <sircharlesaze@gmail.com>2019-10-30 23:35:40 +0100
commitd63d6916249f5b40b81097854d8ca2c9d4d7d071 (patch)
treeb98fe6a060fdb632d00ddf9385f6579a32619f38 /convert_hex_low.c
parent22f334a19cabebf10727d7894102946ba23d0e37 (diff)
downloadft_printf-d63d6916249f5b40b81097854d8ca2c9d4d7d071.tar.gz
ft_printf-d63d6916249f5b40b81097854d8ca2c9d4d7d071.tar.bz2
ft_printf-d63d6916249f5b40b81097854d8ca2c9d4d7d071.zip
Normed converters
Diffstat (limited to 'convert_hex_low.c')
-rw-r--r--convert_hex_low.c37
1 files changed, 0 insertions, 37 deletions
diff --git a/convert_hex_low.c b/convert_hex_low.c
deleted file mode 100644
index 00b2d76..0000000
--- a/convert_hex_low.c
+++ /dev/null
@@ -1,37 +0,0 @@
-#include <stdarg.h>
-#include <stdlib.h>
-#include "header.h"
-
-char *convert_hex_low(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_LOW(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);
-}