From 742a6b48a196cabf65354862548c07d057a28d55 Mon Sep 17 00:00:00 2001 From: Zac Pullar-Strecker Date: Sun, 25 Nov 2018 10:08:02 +1300 Subject: Fix for an underflow on some type conversions (#1715) --- winpty/src/windows.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'winpty') 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) { -- cgit v1.2.3-54-g00ecf