Skip to content

Commit

Permalink
fix bug checking for header consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
carltimmer committed Feb 13, 2024
1 parent 75f721e commit 9a1f60e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libsrc++/Reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ std::cout << "findRecInfo: buf cap = " << buf.capacity() << ", offset = " << off
uint32_t indexArrayLen = recordHeader.getIndexLength(); // bytes

// Consistency check, index array length reflects # of events properly?
if (indexArrayLen > 0 && (indexArrayLen != 4*eventCount)) {
if (!recordHeader.getHeaderType().isTrailer() && indexArrayLen > 0 && (indexArrayLen != 4*eventCount)) {
throw EvioException("index array len (" + std::to_string(indexArrayLen) +
") and 4*eventCount (" + std::to_string(4*eventCount) + ") contradict each other");
}
Expand Down Expand Up @@ -1333,7 +1333,7 @@ std::cout << "findRecInfo: buf cap = " << buf.capacity() << ", offset = " << off
uint32_t indexArrayLen = recordHeader.getIndexLength(); // bytes

// Consistency check, index array length reflects # of events properly?
if (indexArrayLen > 0 && (indexArrayLen != 4*eventCount)) {
if (!recordHeader.getHeaderType().isTrailer() && indexArrayLen > 0 && (indexArrayLen != 4*eventCount)) {
throw EvioException("index array len (" + std::to_string(indexArrayLen) +
") and 4*eventCount (" + std::to_string(4*eventCount) + ") contradict each other");
}
Expand Down

0 comments on commit 9a1f60e

Please sign in to comment.