summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/s_init.c5
-rw-r--r--src/u_vars.c5
2 files changed, 6 insertions, 4 deletions
diff --git a/src/s_init.c b/src/s_init.c
index f8037b9..7d2b656 100644
--- a/src/s_init.c
+++ b/src/s_init.c
@@ -109,7 +109,7 @@ static void
{
char fmt[8];
char tmp[255];
- char *str;
+ char str[255];
int32_t shlvl;
u_get_var_value(tmp, "$SHLVL", 255, msh);
@@ -125,9 +125,8 @@ static void
f_shlvl_too_high(shlvl);
shlvl = (shlvl >= 999) ? 0 : shlvl;
shlvl = (shlvl < 0) ? 0 : shlvl + 1;
- str = ft_itoa(shlvl);
+ ft_itoa_s(str, shlvl);
u_subst_var_value("$SHLVL", str, msh);
- ft_memdel((void*)&str);
}
}
diff --git a/src/u_vars.c b/src/u_vars.c
index 97fc580..28040b4 100644
--- a/src/u_vars.c
+++ b/src/u_vars.c
@@ -54,9 +54,12 @@ static void
size_t dstsize,
t_msh *msh)
{
+ char tmp[4];
+
if (ft_strncmp(varname, FT_RET_VAR, 3) == 0)
{
- ft_strlcpy(str, ft_uitoa(msh->ret), 4);
+ ft_uitoa_s(tmp, msh->ret);
+ ft_strlcpy(str, tmp, 4);
}
else if (ft_strncmp(varname, FT_ZER_VAR, 3) == 0)
{