From 686b356247ed913b9da0010ce9bc1e0cbbaef6cc Mon Sep 17 00:00:00 2001 From: 10195501441 <10195501441@stu.ecnu.edu.com> Date: Tue, 16 Mar 2021 10:18:59 +0800 Subject: [PATCH] fix macrodefinition --- yeeshell.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yeeshell.c b/yeeshell.c index bd3ab68..55e947f 100644 --- a/yeeshell.c +++ b/yeeshell.c @@ -30,7 +30,7 @@ int main() char *cmdline = NULL, *pwd = NULL; char *args[ARGS_MAX_QUANTITY]; int status = 1; - pwd = (char *)calloc(PATH_MAX, sizeof(char)); + pwd = (char *)calloc(PATH_MAX_SIZE, sizeof(char)); for (int i = 0; i < CMDLINE_HISTORY_MAX_QUANTITY; i++) { history[i] = (char *)calloc(CMDLINE_MAX_SIZE, sizeof(char)); @@ -48,7 +48,7 @@ int main() /* execute the shell's read, parse and execution loop */ do { - if (!getcwd(pwd, PATH_MAX)) + if (!getcwd(pwd, PATH_MAX_SIZE)) { printf("yeeshell: The current path cannot be obtained!\n"); exit(0);