X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bam_import.c;h=2cadfcc6c73bd2f185616759d9ead6a75e543a14;hb=941542dfbedf4ba4850d3c1d6b96981234fd6560;hp=c6fbafce979d93560d80265807833a8c9972dca0;hpb=cda19b934bd93b31e654fd84819fb8a54e554181;p=samtools.git diff --git a/bam_import.c b/bam_import.c index c6fbafc..2cadfcc 100644 --- a/bam_import.c +++ b/bam_import.c @@ -297,7 +297,11 @@ int sam_read1(tamFile fp, bam_header_t *header, bam1_t *b) doff += c->l_qname; } { // flag, tid, pos, qual - ret = ks_getuntil(ks, KS_SEP_TAB, str, &dret); z += str->l + 1; c->flag = atoi(str->s); + long flag; + char *s; + ret = ks_getuntil(ks, KS_SEP_TAB, str, &dret); z += str->l + 1; + flag = strtol((char*)str->s, &s, 0); + c->flag = flag; ret = ks_getuntil(ks, KS_SEP_TAB, str, &dret); z += str->l + 1; c->tid = bam_get_tid(header, str->s); if (c->tid < 0 && strcmp(str->s, "*")) { if (header->n_targets == 0) {