Skip to content

Commit

Permalink
vt100: Check more bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
pvolok committed Sep 27, 2022
1 parent af2d777 commit fedf951
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions vendor/vt100/src/row.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,15 @@ impl Row {
pub fn clear_wide(&mut self, col: u16) {
let cell = &self.cells[usize::from(col)];
let other = if cell.is_wide() {
&mut self.cells[usize::from(col + 1)]
self.cells.get_mut(usize::from(col + 1))
} else if cell.is_wide_continuation() {
&mut self.cells[usize::from(col - 1)]
self.cells.get_mut(usize::from(col - 1))
} else {
return;
};
other.clear(*other.attrs());
if let Some(other) = other {
other.clear(*other.attrs());
}
}

pub fn write_contents(
Expand Down

0 comments on commit fedf951

Please sign in to comment.