Fix read bug
Reproduction code: import time s = "--------- switch to main\n--------- switch to system\n" print(s[:0xc], end='', flush=True) time.sleep(1) print(s[0xc:], end='', flush=True)
This commit is contained in:
parent
b6ad9c5d90
commit
d5cf2584db
|
@ -35,8 +35,8 @@ static inline void look_for_newlines(char buf[NEWLINE_BUF_SIZE], size_t* used, s
|
||||||
size_t newline_length = (reinterpret_cast<size_t>(newline_ptr) - reinterpret_cast<size_t>(&buf[real_offset])) / sizeof(char);
|
size_t newline_length = (reinterpret_cast<size_t>(newline_ptr) - reinterpret_cast<size_t>(&buf[real_offset])) / sizeof(char);
|
||||||
(logcat_thread->*handle_line)(&buf[real_offset], newline_length, is_stdout);
|
(logcat_thread->*handle_line)(&buf[real_offset], newline_length, is_stdout);
|
||||||
|
|
||||||
search_offset += newline_length + 1;
|
real_offset += newline_length + 1;
|
||||||
real_offset = search_offset;
|
search_offset = real_offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (real_offset) {
|
if (real_offset) {
|
||||||
|
|
Loading…
Reference in New Issue