Fix pointer bug in logging.
authorDavin McCall <davmac@davmac.org>
Wed, 24 May 2017 08:17:31 +0000 (09:17 +0100)
committerDavin McCall <davmac@davmac.org>
Wed, 24 May 2017 08:17:31 +0000 (09:17 +0100)
src/dinit-log.cc

index e402f6bf2c6112f9174a52f4baeef8597cdf50d5..7a8db587c3fccda77d8b018745097139f6744e2e 100644 (file)
@@ -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<char *>(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'