From e267ecc4e781ada23f4dfb20104ca2c1187f6f36 Mon Sep 17 00:00:00 2001 From: rick Date: Wed, 17 Feb 2021 15:36:34 +0100 Subject: [PATCH] Modif allocation user_input --- src/shell_tools/parser.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/shell_tools/parser.c b/src/shell_tools/parser.c index 334cd8d..143377b 100644 --- a/src/shell_tools/parser.c +++ b/src/shell_tools/parser.c @@ -19,8 +19,7 @@ */ char* get_input() { - char *buffer = (char *) malloc(MAX_LENGTH); - memset(buffer, 0, MAX_LENGTH); + char *buffer = (char *) calloc(MAX_LENGTH, sizeof(char)); buffer[0] = '\n'; while (buffer[0] == '\n')