From 851a0f5bbb6f040761a7a4a0854ecac48eab1ecb Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Thu, 24 Sep 2020 17:20:20 +0200 Subject: Fixed $n stuff --- src/u_vars.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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)); -- cgit v1.2.3