summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-12-07 15:00:09 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-12-07 15:00:09 +0000
commit39a4fc8b57949fab45f7b9c0c3f1c39f6f7aa967 (patch)
tree00e750757634a6fc09910c0dcd56a215f5e728d6
parent7401aa6afef2f64ef127484912f6fdf143cb5588 (diff)
downloads6-rc-39a4fc8b57949fab45f7b9c0c3f1c39f6f7aa967.tar.xz
Get this right, maybe?
-rw-r--r--src/libs6rc/s6rc_livedir_create.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libs6rc/s6rc_livedir_create.c b/src/libs6rc/s6rc_livedir_create.c
index 868eca9..4454111 100644
--- a/src/libs6rc/s6rc_livedir_create.c
+++ b/src/libs6rc/s6rc_livedir_create.c
@@ -18,8 +18,9 @@ int s6rc_livedir_create (stralloc *sa, char const *live, char const *suffix, cha
if (!stralloc_cats(sa, ":")) goto err ;
if (!stralloc_cats(sa, suffix)) goto err ;
if (!stralloc_cats(sa, ":XXXXXX")) goto err ;
+ if (!stralloc_0(sa)) goto err ;
if (!mkdtemp(sa->s + sabase)) goto err ;
- newlen = sa->len ;
+ newlen = sa->len-- ;
if (chmod(sa->s + sabase, 0755) < 0) goto delerr ;
if (!stralloc_catb(sa, "/servicedirs", 13)) goto delerr ; /* allocates enough for the next strcpys */
if (mkdir(sa->s + sabase, 0755) < 0) goto delerr ;