From aff2828ab35916ae19f9431af6fae8c97eae4c43 Mon Sep 17 00:00:00 2001 From: Svenja Mehringer Date: Sun, 13 Feb 2022 11:13:24 +0100 Subject: [PATCH] fix --- include/bio/format/sam_input_handler.hpp | 5 ----- include/bio/map_io/sam_tag_dictionary.hpp | 2 +- test/unit/format/sam_input_test.cpp | 3 +-- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/include/bio/format/sam_input_handler.hpp b/include/bio/format/sam_input_handler.hpp index 0d0bc86..734ab59 100644 --- a/include/bio/format/sam_input_handler.hpp +++ b/include/bio/format/sam_input_handler.hpp @@ -294,11 +294,6 @@ class format_input_handler : public format_input_handler_base if (tag_value.size() % 2 != 0) throw format_error{"Hexadecimal tag has an uneven number of digits!"}; - for (char const * ptr = tag_value.data(); ptr != tag_value.data() + tag_value.size(); ptr += 2) + for (char const * ptr = tag_value.data(); ptr < tag_value.data() + tag_value.size(); ptr += 2) { uint8_t tmp_byte{}; // std::from_chars cannot directly parse into a std::byte diff --git a/test/unit/format/sam_input_test.cpp b/test/unit/format/sam_input_test.cpp index a6587b8..0f4a763 100644 --- a/test/unit/format/sam_input_test.cpp +++ b/test/unit/format/sam_input_test.cpp @@ -106,8 +106,7 @@ read1 41 * 1 61 1S1M1D1M1I * 0 0 ACGT !##$ )"}; std::string wrong_hexadecimal_tag{ -R"(@SQ SN:ref LN:150 -read1 41 ref 1 61 1S1M1D1M1I = 10 300 ACGT !##$ bH:H:1AE30 +R"(read1 41 ref 1 61 1S1M1D1M1I ref 10 300 ACGT !##$ bH:H:1AE30 )"}; };