quelques petits essais

This commit is contained in:
hugogogo
2021-10-10 20:51:04 +02:00
parent 726bb56442
commit 4b74853dc1

View File

@@ -6,7 +6,7 @@
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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);
*/