summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/u_vars.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/u_vars.c b/src/u_vars.c
index eafcace..17221f5 100644
--- a/src/u_vars.c
+++ b/src/u_vars.c
@@ -69,7 +69,7 @@ static void
}
else if (ft_strlen(varname) == 2 && ft_isdigit(*(varname + 1)) == TRUE)
{
- if ((n = ft_atoi(varname + 1)) < msh->argc)
+ if ((n = ft_atoi(varname + 1)) <= msh->argc)
ft_strlcpy(str, msh->argv[n], dstsize);
else
(void)ft_memcpy(str, "", 1 * sizeof(char));