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

10
bwa.c
View File

@ -370,11 +370,13 @@ int bwa_idx2mem(bwaidx_t *idx)
void bwa_print_sam_hdr(const bntseq_t *bns, const char *hdr_line)
{
int i, n_SQ = 0;
const char *p = hdr_line;
extern char *bwa_pg;
while ((p = strstr(p, "@SQ\t")) != 0) {
if (p == hdr_line || *(p-1) == '\n') ++n_SQ;
p += 4;
if (hdr_line) {
const char *p = hdr_line;
while ((p = strstr(p, "@SQ\t")) != 0) {
if (p == hdr_line || *(p-1) == '\n') ++n_SQ;
p += 4;
}
}
if (n_SQ == 0) {
for (i = 0; i < bns->n_seqs; ++i)

2
main.c
View File

@ -4,7 +4,7 @@
#include "utils.h"
#ifndef PACKAGE_VERSION
#define PACKAGE_VERSION "0.7.10-r1025-dirty"
#define PACKAGE_VERSION "0.7.10-r1027-dirty"
#endif
int bwa_fa2pac(int argc, char *argv[]);