am 4423df76: Merge "logcat: add sanity check"

* commit '4423df76f589e9fbd566f368c453758451c82f78':
  logcat: add sanity check
This commit is contained in:
Nick Kralevich 2011-10-18 12:44:19 -07:00 committed by Android Git Automerger
commit 942cfefc61
1 changed files with 5 additions and 0 deletions

View File

@ -296,6 +296,11 @@ static void readLogLines(log_device_t* devices)
fprintf(stderr, "read: Unexpected EOF!\n");
exit(EXIT_FAILURE);
}
else if (entry->entry.len != ret - sizeof(struct logger_entry)) {
fprintf(stderr, "read: unexpected length. Expected %d, got %d\n",
entry->entry.len, ret - sizeof(struct logger_entry));
exit(EXIT_FAILURE);
}
entry->entry.msg[entry->entry.len] = '\0';