mirror of
https://github.com/Team4388/2022NoWayHome.git
synced 2026-06-09 00:38:05 -06:00
Fix bounds issue with empty log flushes
This commit is contained in:
@@ -130,7 +130,7 @@ public class AnsiLogging {
|
|||||||
return new PrintStream(new ByteArrayOutputStream() {
|
return new PrintStream(new ByteArrayOutputStream() {
|
||||||
@Override
|
@Override
|
||||||
public void flush() throws IOException {
|
public void flush() throws IOException {
|
||||||
String s = new String(buf, 0, strip ? count - 1 : count);
|
String s = new String(buf, 0, strip ? Math.max(0, count - 1) : count);
|
||||||
if (!s.isBlank()) logger.accept(s);
|
if (!s.isBlank()) logger.accept(s);
|
||||||
reset();
|
reset();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user