summaryrefslogtreecommitdiff
path: root/src/libs6rc/s6rc_livedir_create.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-12-07 15:57:39 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-12-07 15:57:39 +0000
commit4870ccf23a36c5ccf4a6a4cc1ff6f086a028ed7d (patch)
tree3cbe20b887f85b136690ecfb03ded99d85277350 /src/libs6rc/s6rc_livedir_create.c
parentde1f9afb36117743bd6efb009e6ebf01b34c93f4 (diff)
downloads6-rc-4870ccf23a36c5ccf4a6a4cc1ff6f086a028ed7d.tar.xz
Fix (hopefully) the two remaining bugs in s6-rc-update...
Diffstat (limited to 'src/libs6rc/s6rc_livedir_create.c')
-rw-r--r--src/libs6rc/s6rc_livedir_create.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libs6rc/s6rc_livedir_create.c b/src/libs6rc/s6rc_livedir_create.c
index 4454111..e1fd896 100644
--- a/src/libs6rc/s6rc_livedir_create.c
+++ b/src/libs6rc/s6rc_livedir_create.c
@@ -32,8 +32,8 @@ int s6rc_livedir_create (stralloc *sa, char const *live, char const *suffix, cha
if (!openwritenclose_unsafe(sa->s + sabase, prefix, strlen(prefix))) goto delerr ;
strcpy(sa->s + newlen, "state") ;
if (!openwritenclose_unsafe(sa->s + sabase, (char const *)state, statelen)) goto delerr ;
- sa->len = newlen ;
- sa->s[newlen] = 0 ;
+ sa->len = newlen-1 ;
+ sa->s[newlen-1] = 0 ;
*dirlen = ddirlen ;
return 1 ;