From 4870ccf23a36c5ccf4a6a4cc1ff6f086a028ed7d Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Thu, 7 Dec 2017 15:57:39 +0000 Subject: Fix (hopefully) the two remaining bugs in s6-rc-update... --- src/libs6rc/s6rc_livedir_create.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libs6rc') 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 ; -- cgit v1.2.3