diff --git a/bntseq.c b/bntseq.c index 972837e..540e966 100644 --- a/bntseq.c +++ b/bntseq.c @@ -124,7 +124,7 @@ bntseq_t *bns_restore_core(const char *ann_filename, const char* amb_filename, c fscanf(fp, "%lld%d%d", &xx, &n_seqs, &bns->n_holes); l_pac = xx; xassert(l_pac == bns->l_pac && n_seqs == bns->n_seqs, "inconsistent .ann and .amb files."); - bns->ambs = (bntamb1_t*)calloc(bns->n_holes, sizeof(bntamb1_t)); + bns->ambs = bns->n_holes? (bntamb1_t*)calloc(bns->n_holes, sizeof(bntamb1_t)) : 0; for (i = 0; i < bns->n_holes; ++i) { bntamb1_t *p = bns->ambs + i; fscanf(fp, "%lld%d%s", &xx, &p->len, str); diff --git a/main.c b/main.c index 7499609..91a62cc 100644 --- a/main.c +++ b/main.c @@ -4,7 +4,7 @@ #include "utils.h" #ifndef PACKAGE_VERSION -#define PACKAGE_VERSION "0.7.0-r315" +#define PACKAGE_VERSION "0.7.0-r316" #endif static int usage()