From cda85be059ad845edaf89d020c0d5edd35f04187 Mon Sep 17 00:00:00 2001 From: Heng Li Date: Sat, 23 Feb 2013 17:15:07 -0500 Subject: [PATCH] fixed a couple bugs identified by gcc Recent gcc is better. --- bwamem.c | 2 +- bwase.c | 4 ++-- kopen.c | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bwamem.c b/bwamem.c index 553fe1c..7daa5d2 100644 --- a/bwamem.c +++ b/bwamem.c @@ -569,7 +569,7 @@ void bwa_hit2sam(kstring_t *str, const int8_t mat[25], int q, int r, int w, cons } if (p->score >= 0) { kputsn("\tAS:i:", 6, str); kputw(p->score, str); } if (p->sub >= 0) { kputsn("\tXS:i:", 6, str); kputw(p->sub, str); } - if (bwa_rg_id) { kputsn("\tRG:i:", 6, str); kputs(bwa_rg_id, str); } + if (bwa_rg_id[0]) { kputsn("\tRG:i:", 6, str); kputs(bwa_rg_id, str); } if (s->comment) { kputc('\t', str); kputs(s->comment, str); } kputc('\n', str); free(cigar); diff --git a/bwase.c b/bwase.c index 27da794..2dd783b 100644 --- a/bwase.c +++ b/bwase.c @@ -434,7 +434,7 @@ void bwa_print_sam1(const bntseq_t *bns, bwa_seq_t *p, const bwa_seq_t *mate, in err_printf("%s", p->qual); } else err_printf("*"); - if (bwa_rg_id) err_printf("\tRG:Z:%s", bwa_rg_id); + if (bwa_rg_id[0]) err_printf("\tRG:Z:%s", bwa_rg_id); if (p->bc[0]) err_printf("\tBC:Z:%s", p->bc); if (p->clip_len < p->full_len) err_printf("\tXC:i:%d", p->clip_len); if (p->type != BWA_TYPE_NO_MATCH) { @@ -482,7 +482,7 @@ void bwa_print_sam1(const bntseq_t *bns, bwa_seq_t *p, const bwa_seq_t *mate, in if (p->strand) seq_reverse(p->len, p->qual, 0); // reverse quality err_printf("%s", p->qual); } else err_printf("*"); - if (bwa_rg_id) err_printf("\tRG:Z:%s", bwa_rg_id); + if (bwa_rg_id[0]) err_printf("\tRG:Z:%s", bwa_rg_id); if (p->bc[0]) err_printf("\tBC:Z:%s", p->bc); if (p->clip_len < p->full_len) err_printf("\tXC:i:%d", p->clip_len); putchar('\n'); diff --git a/kopen.c b/kopen.c index f72735c..8c191bc 100644 --- a/kopen.c +++ b/kopen.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #ifndef _WIN32 #include