unsigned subtraction overflow fix

This commit is contained in:
Henrik Friedrichsen
2019-04-09 22:49:10 +02:00
parent 69e6c77753
commit f6d674d9be

View File

@@ -188,7 +188,7 @@ impl View for Layout {
cmdline_height += 1;
}
if position.y < self.last_size.y - 2 - cmdline_height {
if position.y < self.last_size.y.saturating_sub(2 + cmdline_height) {
if let Some(ref id) = self.focus {
let screen = self.views.get_mut(id).unwrap();
screen.view.on_event(event.clone());