summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/var.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/var.c b/src/var.c
index a7791eb..ea62327 100644
--- a/src/var.c
+++ b/src/var.c
@@ -231,9 +231,8 @@ setvar(const char *name, const char *val, int flags)
 	}
 	INTOFF;
 	p = mempcpy(nameeq = ckmalloc(namelen + vallen + 2), name, namelen);
-	*p++ = '\0';
 	if (val) {
-		p[-1] = '=';
+		*p++ = '=';
 		p = mempcpy(p, val, vallen);
 	}
 	*p = '\0';