fixed a segfault when there are too few good bases.

This commit is contained in:
Heng Li 2011-11-17 22:13:38 -05:00
parent c8edcafb44
commit 8f89f55484
3 changed files with 3 additions and 2 deletions

View File

@ -29,6 +29,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <zlib.h> #include <zlib.h>
#include <unistd.h>
#include "bntseq.h" #include "bntseq.h"
#include "main.h" #include "main.h"
#include "utils.h" #include "utils.h"

View File

@ -574,7 +574,7 @@ static void bsw2_aln_core(bsw2seq_t *_seq, const bsw2opt_t *_opt, const bntseq_t
rseq[1][i] = c; rseq[1][i] = c;
} }
if (l - k < opt.t) { // too few unambiguous bases if (l - k < opt.t) { // too few unambiguous bases
buf[x] = 0; buf[x] = calloc(1, sizeof(bwtsw2_t));
free(seq[0]); continue; free(seq[0]); continue;
} }
// alignment // alignment

2
main.c
View File

@ -4,7 +4,7 @@
#include "utils.h" #include "utils.h"
#ifndef PACKAGE_VERSION #ifndef PACKAGE_VERSION
#define PACKAGE_VERSION "0.6.0-r85" #define PACKAGE_VERSION "0.6.0-r89-dev"
#endif #endif
static int usage() static int usage()