summaryrefslogtreecommitdiffstats
path: root/src/u_vars.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-09-24 17:20:20 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-09-24 17:20:20 +0200
commit851a0f5bbb6f040761a7a4a0854ecac48eab1ecb (patch)
treedc9f44a43716d35826b3c8784cd726d3392c1aad /src/u_vars.c
parentCanceling stuff (diff)
download42-minishell-851a0f5bbb6f040761a7a4a0854ecac48eab1ecb.tar.gz
42-minishell-851a0f5bbb6f040761a7a4a0854ecac48eab1ecb.tar.bz2
42-minishell-851a0f5bbb6f040761a7a4a0854ecac48eab1ecb.tar.xz
42-minishell-851a0f5bbb6f040761a7a4a0854ecac48eab1ecb.tar.zst
42-minishell-851a0f5bbb6f040761a7a4a0854ecac48eab1ecb.zip
Fixed $n stuff
Diffstat (limited to 'src/u_vars.c')
-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));