aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2019-11-04 10:10:16 -0500
committerJesse Luehrs <doy@tozt.net>2019-11-04 10:10:16 -0500
commite7beaa60f8c246190a8d9089c66d546abadab577 (patch)
tree198390372669f26b59e711607cef28a67f4d87ee
parentc22aa86e33e3cdf987e6a1a4a15c729b0d3675dd (diff)
downloadttyrec-e7beaa60f8c246190a8d9089c66d546abadab577.tar.gz
ttyrec-e7beaa60f8c246190a8d9089c66d546abadab577.zip
need to perform this multiplication as u64
otherwise it can overflow the u32 before calling u64::from
-rw-r--r--src/parser.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/parser.rs b/src/parser.rs
index 02f2178..7acbbe9 100644
--- a/src/parser.rs
+++ b/src/parser.rs
@@ -8,9 +8,9 @@ struct Header {
impl Header {
fn time(&self) -> std::time::Duration {
- std::time::Duration::from_micros(u64::from(
- self.secs * 1_000_000 + self.micros,
- ))
+ std::time::Duration::from_micros(
+ u64::from(self.secs) * 1_000_000 + u64::from(self.micros),
+ )
}
fn len(&self) -> usize {