From 6e456095fce214a2eadea0cafa3fa7ea1113b4e6 Mon Sep 17 00:00:00 2001 From: Charles Date: Sun, 19 Jul 2020 19:27:52 +0200 Subject: Added errof for cleaner error message, Removed previous error functions --- src/builtin/exit.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/builtin/exit.c') diff --git a/src/builtin/exit.c b/src/builtin/exit.c index 860325e..3f1d843 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/07/17 16:36:03 by charles ### ########.fr */ +/* Updated: 2020/07/19 19:12:46 by charles ### ########.fr */ /* */ /* ************************************************************************** */ @@ -33,16 +33,12 @@ int builtin_exit(char **argv, t_env env) after++; if (*after != '\0' || errno == ERANGE) { - // replace with minishell error system - ft_putstr_fd("minishell: exit: ", STDERR_FILENO); - ft_putstr_fd(argv[1], STDERR_FILENO); - ft_putstr_fd(": numeric argument required\n", STDERR_FILENO); + errorf("exit: %s: numeric argument required\n", argv[1]); return 2; } if (argv[2] != NULL) { - // replace with minishell error system - ft_putendl_fd("minishell: exit: too many arguments", STDERR_FILENO); + errorf("exit: too many arguments\n"); return 1; } } -- cgit