diff --git a/lib/roken/detach.c b/lib/roken/detach.c index e9fbafc39..626e1e608 100644 --- a/lib/roken/detach.c +++ b/lib/roken/detach.c @@ -159,7 +159,7 @@ roken_detach_prep(int argc, char **argv, char *special_arg) ROKEN_LIB_FUNCTION void ROKEN_LIB_CALL roken_detach_finish(const char *dir, int daemon_child_fd) { - char buf[1]; + char buf[1] = ""; ssize_t bytes; int fd; @@ -187,7 +187,6 @@ roken_detach_finish(const char *dir, int daemon_child_fd) err(1, "failed to chdir to /"); #endif - buf[1] = 0; do { bytes = write(pipefds[1], buf, sizeof(buf)); } while (bytes == -1 && errno == EINTR);