Really avoid underflow with apt scrolling

I thought I took care of this in 7c0536f9a3,
but I misunderstood how saturating_sub works.  I still need to clamp
it within range.
This commit is contained in:
Wez Furlong committed 2018-02-24 20:59:44 -08:00
1 parent f4d3ea6e05
commit b81fb73c37
1 file changed
+2 -2
+2 -2
View File
@@ -369,8 +369,8 @@ impl<'a> CSIParser<'a> {
&[top, bottom] => {
self.advance_by(2, params);
Some(CSIAction::SetScrollingRegion {
top: top.saturating_sub(1),
bottom: bottom.saturating_sub(1),
top: top.saturating_sub(1).max(0),
bottom: bottom.saturating_sub(1).max(0),
})
}
&[] => {