Skip to content

Commit aff2828

Browse files
committed
fix
1 parent 84a8f15 commit aff2828

File tree

3 files changed

+2
-8
lines changed

3 files changed

+2
-8
lines changed

include/bio/format/sam_input_handler.hpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -294,11 +294,6 @@ class format_input_handler<sam> : public format_input_handler_base<format_input_
294294
header_string += "\n";
295295
}
296296

297-
if (header_string.ends_with("\r\n"))
298-
header_string = header_string.substr(0, header_string.size() - 2);
299-
else if (header_string.ends_with("\n"))
300-
header_string = header_string.substr(0, header_string.size() - 1);
301-
302297
header = map_io::header{};
303298
header.read(header_string);
304299
}

include/bio/map_io/sam_tag_dictionary.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ class sam_tag_dictionary : public std::map<uint16_t, detail::sam_tag_variant>
379379
if (tag_value.size() % 2 != 0)
380380
throw format_error{"Hexadecimal tag has an uneven number of digits!"};
381381

382-
for (char const * ptr = tag_value.data(); ptr != tag_value.data() + tag_value.size(); ptr += 2)
382+
for (char const * ptr = tag_value.data(); ptr < tag_value.data() + tag_value.size(); ptr += 2)
383383
{
384384
uint8_t tmp_byte{};
385385
// std::from_chars cannot directly parse into a std::byte

test/unit/format/sam_input_test.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,7 @@ read1 41 * 1 61 1S1M1D1M1I * 0 0 ACGT !##$
106106
)"};
107107

108108
std::string wrong_hexadecimal_tag{
109-
R"(@SQ SN:ref LN:150
110-
read1 41 ref 1 61 1S1M1D1M1I = 10 300 ACGT !##$ bH:H:1AE30
109+
R"(read1 41 ref 1 61 1S1M1D1M1I ref 10 300 ACGT !##$ bH:H:1AE30
111110
)"};
112111
};
113112

0 commit comments

Comments
 (0)