From: peterjc Date: Mon, 26 Mar 2012 13:23:37 +0000 (+0100) Subject: Record actual sequence in unpad_seq (fixes apparently harmless bug) X-Git-Url: https://git.donarmstrong.com/?p=samtools.git;a=commitdiff_plain;h=bb67db90fd5100502c29fbd96461b93f1ff20591 Record actual sequence in unpad_seq (fixes apparently harmless bug) --- diff --git a/padding.c b/padding.c index 6c8b31f..2b43275 100644 --- a/padding.c +++ b/padding.c @@ -38,8 +38,7 @@ static void unpad_seq(bam1_t *b, kstring_t *s) op = bam_cigar_op(cigar[k]); ol = bam_cigar_oplen(cigar[k]); if (op == BAM_CMATCH || op == BAM_CEQUAL || op == BAM_CDIFF) { - for (i = 0; i < ol; ++i) s->s[s->l++] = bam1_seqi(seq, j); - ++j; + for (i = 0; i < ol; ++i, ++j) s->s[s->l++] = bam1_seqi(seq, j); } else if (op == BAM_CSOFT_CLIP) { j += ol; } else if (op == BAM_CDEL || op == BAM_CPAD) {