Skip to content

Commit

Permalink
r1027: segfault caused by the last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lh3 committed Dec 12, 2014
1 parent 925ddfb commit c561759
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions bwa.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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[]);
Expand Down

0 comments on commit c561759

Please sign in to comment.