diff --git a/src/bam_filt.c b/src/bam_filt.c index 3a2dc0a..08a6414 100644 --- a/src/bam_filt.c +++ b/src/bam_filt.c @@ -88,6 +88,10 @@ int parse_target_list(bam_hdr_t *header){ if(header->n_targets == 0) { fprintf(stderr, "WARNING : no sequences in bam header : in : %s\n", __func__); } + + // strtok will cause a seg fault if you giv it a NULL at least for Unbuntu + if(bamfilt_global_opts.exclude_str == NULL) return 0; + char * pch = strtok (bamfilt_global_opts.exclude_str,","); uint32_t nseq = 0; while (pch != NULL)