Skip to content

Commit

Permalink
use saturatig_sub() to avoid a negative value causing an overflow pan…
Browse files Browse the repository at this point in the history
…ic (#3139)
  • Loading branch information
antiochp authored Nov 26, 2019
1 parent 0c6c464 commit dcfcd3e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bin/tui/logs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit dcfcd3e

Please sign in to comment.