mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 10:03:45 +01:00
Fix off-by-one in log output line length (#6896)
This commit is contained in:
parent
63f4ee21b0
commit
f77f19a941
@ -347,13 +347,10 @@ void StringBuffer::push_back(char c)
|
|||||||
flush(std::string(buffer, buffer_index));
|
flush(std::string(buffer, buffer_index));
|
||||||
buffer_index = 0;
|
buffer_index = 0;
|
||||||
} else {
|
} else {
|
||||||
int index = buffer_index;
|
buffer[buffer_index++] = c;
|
||||||
buffer[index++] = c;
|
if (buffer_index >= BUFFER_LENGTH) {
|
||||||
if (index >= BUFFER_LENGTH) {
|
|
||||||
flush(std::string(buffer, buffer_index));
|
flush(std::string(buffer, buffer_index));
|
||||||
buffer_index = 0;
|
buffer_index = 0;
|
||||||
} else {
|
|
||||||
buffer_index = index;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user