summaryrefslogtreecommitdiff
path: root/ft_checkpadd.c
diff options
context:
space:
mode:
authoryctct <yctct>2026-01-28 12:43:28 +0100
committeryctct <yctct>2026-01-28 12:43:28 +0100
commit925989f7e7af67d965e2b501a51068acfe449ab0 (patch)
tree7a83e51d2872f9c97abf3166f883ff8dfcf7e2e0 /ft_checkpadd.c
Add all files, first commit
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);
+}