Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
eseiler authored Oct 28, 2022
1 parent c56b32f commit 77648fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/seqan3/io/sam_file/format_bam.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -979,13 +979,13 @@ inline void format_bam::write_header(stream_t & stream, sam_file_output_options
#endif
std::ranges::copy(header_view, stream_it);

assert(header.ref_ids().size() < (1 << 32));
assert(header.ref_ids().size() < (1ull << 32));
int32_t const n_ref{static_cast<int32_t>(header.ref_ids().size())};
std::ranges::copy_n(reinterpret_cast<char const *>(&n_ref), 4, stream_it); // write number of references

for (int32_t ridx = 0; ridx < n_ref; ++ridx)
{
assert(header.ref_ids()[ridx].size() + 1 < (1 << 32));
assert(header.ref_ids()[ridx].size() + 1 < (1ull << 32));
int32_t const l_name{static_cast<int32_t>(header.ref_ids()[ridx].size()) + 1}; // plus null character
std::ranges::copy_n(reinterpret_cast<char const *>(&l_name), 4, stream_it); // write l_name
// write reference name:
Expand Down

0 comments on commit 77648fc

Please sign in to comment.