aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;