use saturatig_sub() to avoid a negative value causing an overflow panic (#3139)
This commit is contained in:
+1
-1
@@ -94,7 +94,7 @@ impl View for LogBufferView {
|
||||
rows.reverse(); // So stack traces are in the right order.
|
||||
for row in rows {
|
||||
for span in row.resolve(&log_message) {
|
||||
p.print((0, p.size.y - 1 - i), span.content);
|
||||
p.print((0, p.size.y.saturating_sub(i + 1)), span.content);
|
||||
i += 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user