diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-07-19 19:27:52 +0200 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-07-19 19:27:52 +0200 |
| commit | 6e456095fce214a2eadea0cafa3fa7ea1113b4e6 (patch) | |
| tree | 42d255dc5042f1df8079567e7ca3426d22cba24d /src/builtin/exit.c | |
| parent | a478d95bed0f24f9783714600af48a6c1cde2aae (diff) | |
| download | minishell-6e456095fce214a2eadea0cafa3fa7ea1113b4e6.tar.gz minishell-6e456095fce214a2eadea0cafa3fa7ea1113b4e6.tar.bz2 minishell-6e456095fce214a2eadea0cafa3fa7ea1113b4e6.zip | |
Added errof for cleaner error message, Removed previous error functions
Diffstat (limited to 'src/builtin/exit.c')
| -rw-r--r-- | src/builtin/exit.c | 10 |
1 files changed, 3 insertions, 7 deletions
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 <charles.cabergs@gmail.com> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* 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; } } |
