diff --git a/bwa.c b/bwa.c index f1d4649..140d57e 100644 --- a/bwa.c +++ b/bwa.c @@ -143,7 +143,7 @@ uint32_t *bwa_gen_cigar(const int8_t mat[25], int q, int r, int w_, int64_t l_pa } x += len; y += len; } else if (op == 2) { // deletion - if (k > 0 && k < *n_cigar) { // don't do the following if D is the first or the last CIGAR + if (k > 0 && k < *n_cigar - 1) { // don't do the following if D is the first or the last CIGAR kputw(u, &str); kputc('^', &str); for (i = 0; i < len; ++i) kputc(int2base[rseq[y+i]], &str); diff --git a/main.c b/main.c index c264abe..803cf10 100644 --- a/main.c +++ b/main.c @@ -4,7 +4,7 @@ #include "utils.h" #ifndef PACKAGE_VERSION -#define PACKAGE_VERSION "0.7.6a+dev-r439" +#define PACKAGE_VERSION "0.7.6a+dev-r440" #endif int bwa_fa2pac(int argc, char *argv[]);