about summary refs log tree commit diff
path: root/Src/params.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/params.c')
-rw-r--r--Src/params.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Src/params.c b/Src/params.c
index 6fb5da57f..35f699033 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -1879,7 +1879,7 @@ assignsparam(char *s, char *val, int augment)
     Value v;
     char *t = s;
     char *ss, *copy, *var;
-    size_t lv;
+    size_t lvar;
     mnumber lhs, rhs;
     int sstart;
 
@@ -1975,10 +1975,10 @@ assignsparam(char *s, char *val, int augment)
 		var = getstrvalue(v);
 		v->start = sstart;
 		copy = val;
-		lv = strlen(var);
-		val = (char *)zalloc(lv + strlen(var));
+		lvar = strlen(var);
+		val = (char *)zalloc(lvar + strlen(val) + 1);
 		strcpy(val, var);
-		strcpy(val + lv, copy);
+		strcpy(val + lvar, copy);
 		zsfree(copy);
 		break;
 	    }