]> git.donarmstrong.com Git - samtools.git/commitdiff
mpileup fix: Print error message and exit when no files given. (On behalf of Gert...
authorPetr Danecek <pd3@sanger.ac.uk>
Wed, 20 Mar 2013 14:09:08 +0000 (14:09 +0000)
committerPetr Danecek <pd3@sanger.ac.uk>
Wed, 20 Mar 2013 14:09:08 +0000 (14:09 +0000)
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;