From 6d8a11f801b41b629d0ad3c71fc5298354ae99ef Mon Sep 17 00:00:00 2001 From: herbert Date: Fri, 25 Mar 2005 20:23:55 +1100 Subject: Eliminate first null termination in setvar. --- ChangeLog | 1 + src/var.c | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3ddfd80..1830be2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,7 @@ * Cleaned up src/Makefile.am. * Get rid of duplicate -g -O2 in CFLAGS. + * Eliminate first null termination in setvar. 2005-03-25 Gilles Chanteperdrix 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'; -- cgit 1.4.1