]> git.donarmstrong.com Git - samtools.git/blobdiff - bam_import.c
Sorry. The old Makefile is for PDCurses...
[samtools.git] / bam_import.c
index c7f866701edd87f37e18fbc9768ed63f68be7f9e..c6fbafce979d93560d80265807833a8c9972dca0 100644 (file)
@@ -154,6 +154,7 @@ int sam_header_parse_rg(bam_header_t *h)
        int n = 0;
 
        // free
+       if (h == 0) return 0;
        bam_strmap_destroy(h->rg2lib); h->rg2lib = 0;
        if (h->l_text < 3) return 0;
        // parse @RG lines
@@ -358,7 +359,7 @@ int sam_read1(tamFile fp, bam_header_t *header, bam1_t *b)
                if (c->n_cigar && c->l_qseq != (int32_t)bam_cigar2qlen(c, bam1_cigar(b)))
                        parse_error(fp->n_lines, "CIGAR and sequence length are inconsistent");
                p = (uint8_t*)alloc_data(b, doff + c->l_qseq + (c->l_qseq+1)/2) + doff;
-               bzero(p, (c->l_qseq+1)/2);
+               memset(p, 0, (c->l_qseq+1)/2);
                for (i = 0; i < c->l_qseq; ++i)
                        p[i/2] |= bam_nt16_table[(int)str->s[i]] << 4*(1-i%2);
                if (ks_getuntil(ks, KS_SEP_TAB, str, &dret) < 0) return -6; // qual