From 81cca36a583add69f4ac87c7bf1aa61cfd1c0cd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Fr=C3=B6jdh?= Date: Mon, 5 Oct 2026 21:09:40 +0200 Subject: [PATCH] Negate the header size as a signed value when seeking back read_header rewinds past the header with seek(-header_size), but header_size is a size_t, so the minus wrapped around and only became -16 again in the conversion to ssize_t. MSVC flags the unsigned negation as C4146. Cast to ssize_t before negating; the offset passed to seek is the same. --- src/JungfrauDataFile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/JungfrauDataFile.cpp b/src/JungfrauDataFile.cpp index 5c19cbc3..6e77a0a6 100644 --- a/src/JungfrauDataFile.cpp +++ b/src/JungfrauDataFile.cpp @@ -221,7 +221,7 @@ JungfrauDataHeader JungfrauDataFile::read_header() { throw std::runtime_error(LOCATION + "Could not read header from file" + m_fp.error_msg()); } - m_fp.seek(-header_size, SEEK_CUR); + m_fp.seek(-static_cast(header_size), SEEK_CUR); return header; }