summaryrefslogtreecommitdiffstats
path: root/winpty
diff options
context:
space:
mode:
authorZac Pullar-Strecker <zacps@users.noreply.github.com>2018-11-25 10:08:02 +1300
committerGitHub <noreply@github.com>2018-11-25 10:08:02 +1300
commit742a6b48a196cabf65354862548c07d057a28d55 (patch)
treefb9846aa3880eec27627b3ac91535d963390e947 /winpty
parent0d47cd25b90deecc2dbf40c8361d2310049fdde7 (diff)
Fix for an underflow on some type conversions (#1715)
Diffstat (limited to 'winpty')
-rw-r--r--winpty/src/windows.rs4
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) {