From 008359ec7173e10e598b16aa6c04ba550712b419 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 14 Jan 2023 17:18:02 +0100 Subject: [PATCH 1/3] bugfix for patch version --- CHANGELOG.md | 8 ++++++++ src/time/cds.rs | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d61eea4..649bfa1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/). # [unreleased] +# [v0.4.1] 14.01.2023 + +## Fixed + +- CDS timestamp: The conversion function from the current time were buggy + when specifying picoseconds precision, which could lead to overflow + multiplications and/or incorrect precision fields. + # [v0.4.0] 10.01.2023 ## Fixed diff --git a/src/time/cds.rs b/src/time/cds.rs index 6e08eba..b9e7ee3 100644 --- a/src/time/cds.rs +++ b/src/time/cds.rs @@ -170,8 +170,8 @@ impl ConversionFromNow { )); } SubmillisPrecision::Picoseconds(_) => { - prec = Some(SubmillisPrecision::Microseconds( - (now.subsec_nanos() * 1000) as u16, + prec = Some(SubmillisPrecision::Picoseconds( + now.subsec_nanos() * 1000 )); } _ => (), From 6989558f930789941875965f2f99fbe36097b523 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 14 Jan 2023 17:20:14 +0100 Subject: [PATCH 2/3] cargo fmt --- src/time/cds.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/time/cds.rs b/src/time/cds.rs index b9e7ee3..399b820 100644 --- a/src/time/cds.rs +++ b/src/time/cds.rs @@ -170,9 +170,7 @@ impl ConversionFromNow { )); } SubmillisPrecision::Picoseconds(_) => { - prec = Some(SubmillisPrecision::Picoseconds( - now.subsec_nanos() * 1000 - )); + prec = Some(SubmillisPrecision::Picoseconds(now.subsec_nanos() * 1000)); } _ => (), } From 1c702f933f4911c0b1925d82d463ede4e1e575fd Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 14 Jan 2023 17:22:27 +0100 Subject: [PATCH 3/3] v0.4.1 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index a2ef1fc..8c34852 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "spacepackets" -version = "0.4.0" +version = "0.4.1" edition = "2021" rust-version = "1.60" authors = ["Robin Mueller "]