From 39a4fc8b57949fab45f7b9c0c3f1c39f6f7aa967 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Thu, 7 Dec 2017 15:00:09 +0000 Subject: Get this right, maybe? --- src/libs6rc/s6rc_livedir_create.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/libs6rc') 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 ; -- cgit v1.2.3