mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2026-11-18 20:44:04 +01:00
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.
This commit is contained in:
1 parent
e6126e2a31
commit
81cca36a58
1 file changed
+1
-1
@@ -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<ssize_t>(header_size), SEEK_CUR);
|
||||
return header;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user