From dcfcd3ee79959599c77a3e895651b801edc2920d Mon Sep 17 00:00:00 2001 From: Antioch Peverell Date: Tue, 26 Nov 2019 19:05:04 +0000 Subject: [PATCH] use saturatig_sub() to avoid a negative value causing an overflow panic (#3139) --- src/bin/tui/logs.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/tui/logs.rs b/src/bin/tui/logs.rs index 2b6bb982c..de9b437dc 100644 --- a/src/bin/tui/logs.rs +++ b/src/bin/tui/logs.rs @@ -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; } }