Skip to content

Commit

Permalink
Check that a filename has been provided [minor]
Browse files Browse the repository at this point in the history
Fixes the segmentation fault mentioned in samtools#1068.
  • Loading branch information
jmarshall committed Sep 20, 2019
1 parent b1c4e52 commit 06d5698
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions plugins/fixref.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ static void dbsnp_init(args_t *args, const char *chr)
args->i2m = kh_init(i2m);
bcf_srs_t *sr = bcf_sr_init();
if ( bcf_sr_set_regions(sr, chr, 0) != 0 ) goto done;
if ( !args->dbsnp_fname ) error("No ID file specified, use -i/--use-id\n");
if ( !bcf_sr_add_reader(sr,args->dbsnp_fname) ) error("Failed to open %s: %s\n", args->dbsnp_fname,bcf_sr_strerror(sr->errnum));
while ( bcf_sr_next_line(sr) )
{
Expand Down

0 comments on commit 06d5698

Please sign in to comment.