Skip to content

Commit 96dc147

Browse files
Merge pull request #144 from smithlabcode/sam_realloc
fixed the order of source and dest in sam_realloc as per the original…
2 parents 6e9eac5 + 97545b9 commit 96dc147

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/common/bam_record_utils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,10 @@ sam_realloc_bam_data(bam1_t *b, size_t desired) {
115115
new_data = static_cast<uint8_t *>(malloc(new_m_data));
116116
if (new_data != nullptr) {
117117
if (b->l_data > 0)
118-
std::copy_n(new_data,
118+
std::copy_n(b->data,
119119
(static_cast<uint32_t>(b->l_data) < b->m_data) ? b->l_data
120120
: b->m_data,
121-
b->data);
121+
new_data);
122122
bam_set_mempolicy(b, bam_get_mempolicy(b) & (~BAM_USER_OWNS_DATA));
123123
}
124124
}

0 commit comments

Comments
 (0)