From aba6f712d46577c45a89fd0626dc251885d7989d Mon Sep 17 00:00:00 2001
From: Elliott Hughes <enh@google.com>
Date: Thu, 5 Feb 2015 12:02:04 -0800
Subject: [PATCH] Apparently, logd does need the NULs.

Change-Id: I04b834e65c26c5821b952f78a0de7f92527cbdba
---
 libc/bionic/libc_logging.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libc/bionic/libc_logging.cpp b/libc/bionic/libc_logging.cpp
index 76bc46ddf..2eb9d68f8 100644
--- a/libc/bionic/libc_logging.cpp
+++ b/libc/bionic/libc_logging.cpp
@@ -513,9 +513,9 @@ static int __libc_write_log(int priority, const char* tag, const char* msg) {
   vec[3].iov_base = &priority;
   vec[3].iov_len = 1;
   vec[4].iov_base = const_cast<char*>(tag);
-  vec[4].iov_len = strlen(tag);
+  vec[4].iov_len = strlen(tag) + 1;
   vec[5].iov_base = const_cast<char*>(msg);
-  vec[5].iov_len = strlen(msg);
+  vec[5].iov_len = strlen(msg) + 1;
 #else
   int main_log_fd = TEMP_FAILURE_RETRY(open("/dev/log/main", O_CLOEXEC | O_WRONLY));
   if (main_log_fd == -1) {
@@ -530,9 +530,9 @@ static int __libc_write_log(int priority, const char* tag, const char* msg) {
   vec[0].iov_base = &priority;
   vec[0].iov_len = 1;
   vec[1].iov_base = const_cast<char*>(tag);
-  vec[1].iov_len = strlen(tag);
+  vec[1].iov_len = strlen(tag) + 1;
   vec[2].iov_base = const_cast<char*>(msg);
-  vec[2].iov_len = strlen(msg);
+  vec[2].iov_len = strlen(msg) + 1;
 #endif
 
   int result = TEMP_FAILURE_RETRY(writev(main_log_fd, vec, sizeof(vec) / sizeof(vec[0])));