aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2020-01-16 07:09:57 -0600
committerRob Landley <rob@landley.net>2020-01-16 07:09:57 -0600
commitdd75e81e3d3aeb02c6edf7df81cf969c548d9be6 (patch)
tree19d9b7fed076ae077b793f57b6fdaa9b1a659356 /lib
parent189d141c6095f86488af735a12d166be924d0511 (diff)
downloadtoybox-dd75e81e3d3aeb02c6edf7df81cf969c548d9be6.tar.gz
The expand should expand.
Diffstat (limited to 'lib')
-rw-r--r--lib/env.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/env.c b/lib/env.c
index 33ad0005..92cc811f 100644
--- a/lib/env.c
+++ b/lib/env.c
@@ -79,7 +79,7 @@ void xsetmyenv(int *envc, char ***env, char *name, char *val)
// resize and null terminate if expanding
if (!(*env)[i]) {
len = i+1;
- if (!(len&255)) *env = xrealloc(*env, len*sizeof(char *));
+ if (!(len&255)) *env = xrealloc(*env, (len+256)*sizeof(char *));
(*env)[len] = 0;
}
(*env)[i] = new;