From: Petr Danecek Date: Wed, 20 Mar 2013 14:09:08 +0000 (+0000) Subject: mpileup fix: Print error message and exit when no files given. (On behalf of Gert... X-Git-Url: https://git.donarmstrong.com/?p=samtools.git;a=commitdiff_plain;h=e7e57afd8b5f432431e26a9fa2146e8daa9267bd mpileup fix: Print error message and exit when no files given. (On behalf of Gert Hulselmans) --- diff --git a/bam_plcmd.c b/bam_plcmd.c index 54a4597..31e3017 100644 --- a/bam_plcmd.c +++ b/bam_plcmd.c @@ -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;