From 94c5437885752dd03434e3fb7f50720374b9c7e5 Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Sun, 13 Sep 2026 14:31:45 +0200 Subject: [PATCH] writer: the temporary file name is defined when the arm date is missing tmp_suffix was left uninitialised and only assigned inside the `if (!arm_date.empty())` body or in the catch handler. An empty arm_date takes neither path, so the `.tmp` file name was formatted from an indeterminate value. Initialise it to the same wall-clock fallback the catch handler already uses. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_011GxZqDiFP3KqriBhNdcR56 --- writer/HDF5DataFile.cpp | 2 +- writer/HDF5NXmx.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/writer/HDF5DataFile.cpp b/writer/HDF5DataFile.cpp index 79e03f706..1c47c12c8 100644 --- a/writer/HDF5DataFile.cpp +++ b/writer/HDF5DataFile.cpp @@ -45,7 +45,7 @@ declared_pixel_signed(msg.pixel_signed) { exptime.reserve(images_per_file); number.reserve(images_per_file); - uint64_t tmp_suffix; + uint64_t tmp_suffix = std::chrono::system_clock::now().time_since_epoch().count(); try { if (!msg.arm_date.empty()) tmp_suffix = parse_UTC_to_ms(msg.arm_date); diff --git a/writer/HDF5NXmx.cpp b/writer/HDF5NXmx.cpp index c37e745b0..30eb8d1b8 100644 --- a/writer/HDF5NXmx.cpp +++ b/writer/HDF5NXmx.cpp @@ -23,7 +23,7 @@ std::string HDF5Metadata::MasterFileName(const StartMessage &start) { NXmx::NXmx(const StartMessage &start) : start_message(start), filename(HDF5Metadata::MasterFileName(start)) { - uint64_t tmp_suffix; + uint64_t tmp_suffix = std::chrono::system_clock::now().time_since_epoch().count(); try { if (!start.arm_date.empty()) tmp_suffix = parse_UTC_to_ms(start.arm_date);