am 63f4a841: liblog: ensure that the message length is consistent

* commit '63f4a84104c228c74cdf132f5cef4f5184ae04bb':
  liblog: ensure that the message length is consistent
This commit is contained in:
Nick Kralevich 2011-10-17 11:04:08 -07:00 committed by Android Git Automerger
commit 2a736093f7
1 changed files with 7 additions and 1 deletions

View File

@ -374,6 +374,13 @@ int android_log_processLogBuffer(struct logger_entry *buf,
entry->messageLen = buf->len - preambleAndNullLen;
entry->message = entry->tag + tag_len + 1;
if (entry->messageLen != strlen(entry->message)) {
fprintf(stderr,
"+++ LOG: Message length inconsistent. Expected %d, got %d\n",
entry->messageLen, strlen(entry->message));
return -1;
}
return 0;
}
@ -830,7 +837,6 @@ char *android_log_formatLogLine (
while(pm < (entry->message + entry->messageLen)) {
const char *lineStart;
size_t lineLen;
lineStart = pm;
// Find the next end-of-line in message