aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_exit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ft_exit.c')
-rw-r--r--src/ft_exit.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/ft_exit.c b/src/ft_exit.c
new file mode 100644
index 0000000..a5b7276
--- /dev/null
+++ b/src/ft_exit.c
@@ -0,0 +1,12 @@
+#include <libft.h>
+#include <stdlib.h>
+#include <inttypes.h>
+
+void
+ft_exit(uint8_t exit_code)
+{
+ ft_printf("Exiting program\n");
+ if (exit_code < 0 || exit_code > 0)
+ ft_printf("Exit code: %hhu\n", exit_code);
+ exit(exit_code);
+}