Skip to content

Commit

Permalink
Fix bgen seek error
Browse files Browse the repository at this point in the history
  • Loading branch information
choishingwan committed Sep 19, 2018
1 parent 5fad4b9 commit b18eeec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions inc/binarygen.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,10 @@ class BinaryGen : public Genotype
// and reset the prev_loc counter
m_prev_loc = 0;
}
if (m_prev_loc != byte_pos
|| !m_bgen_file.seekg(byte_pos, std::ios_base::beg))
if ((m_prev_loc != byte_pos)
&& !m_bgen_file.seekg(byte_pos, std::ios_base::beg))
{
// if the location is not equal and seek fail, we have problem
// if the location is not equal AND seek fail, we have problem
// reading the bed file
throw std::runtime_error(
"Error: Cannot seek within the bgen file!");
Expand Down

0 comments on commit b18eeec

Please sign in to comment.