X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=sam.c;fp=sam.c;h=8411d81f0af8b19e04cc1ffc77e1f741efd6987b;hb=94bf0806a9697592e897f65c0fe8e460451d2021;hp=671b5042bc17ec1948c83fe54093c03ff7065120;hpb=b0ed19dc2d8fb84998d41d6c3588611185707137;p=samtools.git diff --git a/sam.c b/sam.c index 671b504..8411d81 100644 --- a/sam.c +++ b/sam.c @@ -67,10 +67,10 @@ samfile_t *samopen(const char *fn, const char *mode, const void *aux) sam_header_parse(alt); alt->l_text = 0; alt->text = 0; // check if there are @SQ lines in the header + fwrite(fp->header->text, 1, fp->header->l_text, fp->x.tamw); if (alt->n_targets) { // then write the header text without dumping ->target_{name,len} if (alt->n_targets != fp->header->n_targets) fprintf(stderr, "[samopen] inconsistent number of target sequences.\n"); - fwrite(fp->header->text, 1, fp->header->l_text, fp->x.tamw); } else { // then dump ->target_{name,len} for (i = 0; i < fp->header->n_targets; ++i) fprintf(fp->x.tamw, "@SQ\tSN:%s\tLN:%d\n", fp->header->target_name[i], fp->header->target_len[i]);