diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-12-07 15:57:39 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-12-07 15:57:39 +0000 |
commit | 4870ccf23a36c5ccf4a6a4cc1ff6f086a028ed7d (patch) | |
tree | 3cbe20b887f85b136690ecfb03ded99d85277350 /src/libs6rc | |
parent | de1f9afb36117743bd6efb009e6ebf01b34c93f4 (diff) | |
download | s6-rc-4870ccf23a36c5ccf4a6a4cc1ff6f086a028ed7d.tar.xz |
Fix (hopefully) the two remaining bugs in s6-rc-update...
Diffstat (limited to 'src/libs6rc')
-rw-r--r-- | src/libs6rc/s6rc_livedir_create.c | 4 |
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 ; |