]> git.donarmstrong.com Git - samtools.git/blobdiff - bam_plcmd.c
mpileup fix: Print error message and exit when no files given. (On behalf of Gert...
[samtools.git] / bam_plcmd.c
index 54a4597a702d441dc15bfa4070fae16d3905a990..31e3017dcca25be269bd7cb393ae9da83f93c279 100644 (file)
@@ -209,6 +209,11 @@ static int mpileup(mplp_conf_t *conf, int n, char **fn)
        n_plp = calloc(n, sizeof(int*));
        sm = bam_smpl_init();
 
+    if (n == 0) {
+        fprintf(stderr,"[%s] no input file/data given\n", __func__);
+        exit(1);
+    }
+
        // read the header and initialize data
        for (i = 0; i < n; ++i) {
                bam_header_t *h_tmp;