Skip to content

Commit

Permalink
Fix samtools cat error message.
Browse files Browse the repository at this point in the history
Previously  "samtools cat -o /tmp/t/cat.test007.bam -h /tmp/t/cat.hdr ..."
complained about being unable to read '-o'.
  • Loading branch information
jkbonfield committed Jun 22, 2018
1 parent 22caad0 commit cd71974
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bam_cat.c
Expand Up @@ -542,14 +542,14 @@ int main_cat(int argc, char *argv[])
case 'h': {
samFile *fph = sam_open(optarg, "r");
if (fph == 0) {
fprintf(stderr, "[%s] ERROR: fail to read the header from '%s'.\n", __func__, argv[1]);
fprintf(stderr, "[%s] ERROR: fail to read the header from '%s'.\n", __func__, optarg);
return 1;
}
h = sam_hdr_read(fph);
if (h == NULL) {
fprintf(stderr,
"[%s] ERROR: failed to read the header for '%s'.\n",
__func__, argv[1]);
"[%s] ERROR: failed to read the header from '%s'.\n",
__func__, optarg);
return 1;
}
sam_close(fph);
Expand Down

0 comments on commit cd71974

Please sign in to comment.