From 5d896c6fe27a25a402bf890843967804d89499a8 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Sat, 28 Nov 2020 06:20:20 +0100 Subject: Fixing exit not exiting on argument error --- src/builtin/exit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/builtin/exit.c') diff --git a/src/builtin/exit.c b/src/builtin/exit.c index ad0bfa7..a516391 100644 --- a/src/builtin/exit.c +++ b/src/builtin/exit.c @@ -6,7 +6,7 @@ /* By: charles +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/04/01 17:10:16 by charles #+# #+# */ -/* Updated: 2020/10/11 14:27:03 by cacharle ### ########.fr */ +/* Updated: 2020/11/28 06:16:24 by charles ### ########.fr */ /* */ /* ************************************************************************** */ @@ -41,10 +41,10 @@ int builtin_exit(char **argv, t_env env) if (errno == ERANGE || *after != '\0') { errorf("exit: %s: numeric argument required\n", argv[1]); - return (255); + exit(255); } if (argv[2] != NULL) - return (errorf_ret(1, "exit: too many arguments\n")); + exit(errorf_ret(1, "exit: too many arguments\n")); } exit(status % 256); return (0); -- cgit