summaryrefslogtreecommitdiff
path: root/ft_checkpadd.c
diff options
context:
space:
mode:
Diffstat (limited to 'ft_checkpadd.c')
-rw-r--r--ft_checkpadd.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/ft_checkpadd.c b/ft_checkpadd.c
new file mode 100644
index 0000000..a1881d1
--- /dev/null
+++ b/ft_checkpadd.c
@@ -0,0 +1,19 @@
+
+#include "ft_printf.h"
+
+int ft_checkpadd(va_list ap)
+{
+ int counter;
+ unsigned long pointer_address;
+
+ counter = 0;
+ pointer_address = ((long)(va_arg(ap, void *)));
+ if (pointer_address == 0)
+ counter += write(1, "(nil)", 5);
+ else
+ {
+ counter += write(1, "0x", 2);
+ counter += ft_puthexlower(pointer_address);
+ }
+ return (counter);
+}