r1027: segfault caused by the last commit

This commit is contained in:
Heng Li 2014-12-12 16:56:54 -05:00
parent 925ddfb697
commit c561759222
2 changed files with 7 additions and 5 deletions

4
bwa.c
View File

@ -370,12 +370,14 @@ int bwa_idx2mem(bwaidx_t *idx)
void bwa_print_sam_hdr(const bntseq_t *bns, const char *hdr_line) void bwa_print_sam_hdr(const bntseq_t *bns, const char *hdr_line)
{ {
int i, n_SQ = 0; int i, n_SQ = 0;
const char *p = hdr_line;
extern char *bwa_pg; extern char *bwa_pg;
if (hdr_line) {
const char *p = hdr_line;
while ((p = strstr(p, "@SQ\t")) != 0) { while ((p = strstr(p, "@SQ\t")) != 0) {
if (p == hdr_line || *(p-1) == '\n') ++n_SQ; if (p == hdr_line || *(p-1) == '\n') ++n_SQ;
p += 4; p += 4;
} }
}
if (n_SQ == 0) { if (n_SQ == 0) {
for (i = 0; i < bns->n_seqs; ++i) for (i = 0; i < bns->n_seqs; ++i)
err_printf("@SQ\tSN:%s\tLN:%d\n", bns->anns[i].name, bns->anns[i].len); err_printf("@SQ\tSN:%s\tLN:%d\n", bns->anns[i].name, bns->anns[i].len);

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.7.10-r1025-dirty" #define PACKAGE_VERSION "0.7.10-r1027-dirty"
#endif #endif
int bwa_fa2pac(int argc, char *argv[]); int bwa_fa2pac(int argc, char *argv[]);