diff --git a/src/lib.rs b/src/lib.rs
index 5e17207a86855e21acc0c6e81aed668181e4e7bd..aec1000159218dc58f45074116c40860793175ec 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -108,9 +108,9 @@ fn open_serial(args: Args<'_>) -> SResult<()> {
         .map_mexerr(|e| Error::InvalidBaudrate(Box::new(e)))?;
     // Check for arg2 to resemble a baud rate (this type mismatch should be
     // fixed later on)
-    if arg2 != arg2.floor() || !(0.0..=921_600.0).contains(&arg2) {
+    if arg2 != arg2.floor() || !(0.0..=u32::MAX as f64).contains(&arg2) {
         return Err(Error::InvalidBaudrate(Box::new(Error::InvalidMatlabType(
-            "do not use decimal units, use a number between 0 and 115200".into(),
+            "do not use decimal units, use a number greater than zero".into(),
         ))));
     }
     let baudrate = arg2 as u32;