From: Davin McCall Date: Wed, 24 May 2017 08:17:31 +0000 (+0100) Subject: Fix pointer bug in logging. X-Git-Tag: v0.06~121 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=6f6c7973fc8aa2cab04b1758399e29e30e3a7eec;p=oweals%2Fdinit.git Fix pointer bug in logging. --- diff --git a/src/dinit-log.cc b/src/dinit-log.cc index e402f6b..7a8db58 100644 --- a/src/dinit-log.cc +++ b/src/dinit-log.cc @@ -194,7 +194,7 @@ rearm BufferedLogStream::fd_event(EventLoop_t &loop, int fd, int flags) noexcept // Do we need the second span? if (! will_complete && len != log_buffer.get_length()) { ptr = log_buffer.get_buf_base(); - creptr = static_cast(logiov[1].iov_base) + log_buffer.get_length() - len; + creptr = ptr + log_buffer.get_length() - len; eptr = std::find(ptr, creptr, '\n'); if (eptr != creptr) { eptr++; // include '\n'