mirror of
https://github.com/mimblewimble/grin.git
synced 2025-02-01 08:51:08 +03:00
use saturatig_sub() to avoid a negative value causing an overflow panic (#3139)
This commit is contained in:
parent
0c6c464e94
commit
dcfcd3ee79
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue