From af603439b2a1fa98af495f9d3c2be1d74cd24d87 Mon Sep 17 00:00:00 2001 From: Davin McCall Date: Sun, 2 Jun 2019 19:28:57 +1000 Subject: [PATCH] Don't abuse std::find to find end of special message. Cherry-picked from development branch. --- src/dinit-log.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dinit-log.cc b/src/dinit-log.cc index dbdf868..09e4e78 100644 --- a/src/dinit-log.cc +++ b/src/dinit-log.cc @@ -163,7 +163,8 @@ rearm buffered_log_stream::fd_event(eventloop_t &loop, int fd, int flags) noexce if ((! partway) && special) { const char * start = special_buf + msg_index; - const char * end = std::find(special_buf + msg_index, (const char *)nullptr, '\n'); + const char * end = start; + while (*end != '\n') end++; int r = write(fd, start, end - start + 1); if (r >= 0) { if (start + r > end) { -- 2.25.1