mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Make android logging thread only process buffer slice that contains real data.
This commit is contained in:
parent
4e61d97030
commit
e75beaa8d6
1 changed files with 3 additions and 0 deletions
|
@ -491,6 +491,9 @@ fn redirect_stdout_to_logcat() {
|
|||
result as usize + cursor
|
||||
};
|
||||
|
||||
// Only modify the portion of the buffer that contains real data.
|
||||
let buf = &mut buf[0..end];
|
||||
|
||||
if let Some(last_newline_pos) = buf.iter().rposition(|&c| c == b'\n' as c_char) {
|
||||
buf[last_newline_pos] = b'\0' as c_char;
|
||||
unsafe {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue