Skip to content

Commit

Permalink
fix for test_validator_v4 failure on mac
Browse files Browse the repository at this point in the history
  • Loading branch information
vasudeva8 committed Dec 20, 2023
1 parent e931dca commit 37ec539
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions inc/util/string_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ namespace ebi
inline std::string remove_end_of_line(std::string &line)
{
bool has_r = false, has_n = false;
if (line.back() == '\n') {
if (!line.empty() && line.back() == '\n') {
has_n = true;
line.pop_back();
}
if (line.back() == '\r') {
if (!line.empty() && line.back() == '\r') {
has_r = true;
line.pop_back();
}
Expand Down
2 changes: 1 addition & 1 deletion src/vcf/store_parse_policy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ namespace ebi
// check contigs are contiguous
auto iterator = finished_contigs.find(m_line_tokens[CHROM][0]);
bool contig_not_found = iterator == finished_contigs.end();
bool contig_already_finished = iterator->second;
bool contig_already_finished = contig_not_found ? false : iterator->second;
if (contig_not_found) {
// contig not found in the map: finishing the previous contig, and starting a new one
if (finished_contigs.size() != 0) {
Expand Down

0 comments on commit 37ec539

Please sign in to comment.