From 4b74853dc1300752b015ca90c5f169fa74e5e4e2 Mon Sep 17 00:00:00 2001 From: hugogogo Date: Sun, 10 Oct 2021 20:51:04 +0200 Subject: [PATCH] quelques petits essais --- srcs/main.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/srcs/main.c b/srcs/main.c index 34f6d74..6495efc 100644 --- a/srcs/main.c +++ b/srcs/main.c @@ -6,7 +6,7 @@ /* By: lperrey +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2021/10/04 05:59:26 by lperrey #+# #+# */ -/* Updated: 2021/10/10 08:50:20 by lperrey ### ########.fr */ +/* Updated: 2021/10/10 15:13:26 by hulamy ### ########.fr */ /* */ /* ************************************************************************** */ @@ -70,3 +70,13 @@ int main(int argc, char *argv[], char *envp[]) shell_loop(&c); return (0); } + + +/* +** idea about malloc protection : +** have them(mallocand similar) done in a specific function that would check their return and accordingly exit the program or continue +** -> so that it can be done in one line +** void calloc_or_exit(int num, int size); +** and possibly give it a pointer to a function that will clean before exit +** void calloc_or_exit(int num, int size, void (*f)(void *ptr), void *ptr); +*/