diff options
author | Zac Pullar-Strecker <zacps@users.noreply.github.com> | 2018-11-25 10:08:02 +1300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-25 10:08:02 +1300 |
commit | 742a6b48a196cabf65354862548c07d057a28d55 (patch) | |
tree | fb9846aa3880eec27627b3ac91535d963390e947 /winpty | |
parent | 0d47cd25b90deecc2dbf40c8361d2310049fdde7 (diff) | |
download | alacritty-742a6b48a196cabf65354862548c07d057a28d55.tar.gz alacritty-742a6b48a196cabf65354862548c07d057a28d55.zip |
Fix for an underflow on some type conversions (#1715)
Diffstat (limited to 'winpty')
-rw-r--r-- | winpty/src/windows.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/winpty/src/windows.rs b/winpty/src/windows.rs index 67370709..84762585 100644 --- a/winpty/src/windows.rs +++ b/winpty/src/windows.rs @@ -201,12 +201,12 @@ impl<'a, 'b> Winpty<'a> { /// Change the size of the Windows console window. /// /// cols & rows MUST be greater than 0 - pub fn set_size(&mut self, cols: usize, rows: usize) -> Result<(), Err> { + pub fn set_size(&mut self, cols: u16, rows: u16) -> Result<(), Err> { assert!(cols > 0 && rows > 0); let mut err = null_mut() as *mut winpty_error_t; unsafe { - winpty_set_size(self.0, cols as i32, rows as i32, &mut err); + winpty_set_size(self.0, i32::from(cols), i32::from(rows), &mut err); } if let Some(err) = check_err(err) { |