diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2020-10-11 14:54:04 +0200 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2020-10-11 14:54:04 +0200 |
| commit | a4ceb5974d1b7dcdd12cc81b7eb07893ea16c8ad (patch) | |
| tree | 22dd3457717fbc60c4016a7db2aa8f152009cc37 /src/builtin/exit.c | |
| parent | 8224c28be6d9229cf3e4b2c21f4ec81a4083caa8 (diff) | |
| download | minishell-a4ceb5974d1b7dcdd12cc81b7eb07893ea16c8ad.tar.gz minishell-a4ceb5974d1b7dcdd12cc81b7eb07893ea16c8ad.tar.bz2 minishell-a4ceb5974d1b7dcdd12cc81b7eb07893ea16c8ad.zip | |
Fixing read of uninitialized value error in bultin/exit.c
Diffstat (limited to 'src/builtin/exit.c')
| -rw-r--r-- | src/builtin/exit.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/builtin/exit.c b/src/builtin/exit.c index aa70a00..ad0bfa7 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/09/28 10:51:42 by cacharle ### ########.fr */ +/* Updated: 2020/10/11 14:27:03 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -36,9 +36,9 @@ int builtin_exit(char **argv, t_env env) { errno = 0; status = ft_strtol(argv[1], &after, 10); - while (ft_isblank(*after)) + while (after != NULL && ft_isblank(*after)) after++; - if (*after != '\0' || errno == ERANGE) + if (errno == ERANGE || *after != '\0') { errorf("exit: %s: numeric argument required\n", argv[1]); return (255); |
