summaryrefslogtreecommitdiffstats
path: root/src/ft_exit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ft_exit.c')
-rw-r--r--src/ft_exit.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ft_exit.c b/src/ft_exit.c
index 513b4d1..f91183d 100644
--- a/src/ft_exit.c
+++ b/src/ft_exit.c
@@ -24,17 +24,17 @@ ft_exit(char **com)
ft_putendl("exit");
while (com[i])
i++;
- if (i > 2)
- return (ft_error(com[0], 1));
- else if (com[1])
+ if (i == 2)
{
i = 0;
while (ft_isdigit(com[1][i]))
i++;
if (i != ft_strlen(com[1]))
- return (ft_error(com[0], 255));
+ exit(ft_error(com[0], 255));
else
exit((uint8_t)ft_atoi(com[1]));
}
+ else if (i > 2)
+ return (ft_error(com[0], 1));
exit(0);
}