]> git.donarmstrong.com Git - samtools.git/blobdiff - bcftools/call1.c
* samtools-0.1.12-10 (r896)
[samtools.git] / bcftools / call1.c
index 809fe344bfd0a7abf822b82db3670c25ed47689c..e4ba879a64b3d6bdd4f9ff230457b6e4394c784b 100644 (file)
@@ -208,8 +208,10 @@ static char **read_samples(const char *fn, int *_n)
        kstring_t s;
        int dret, n = 0, max = 0;
        char **sam = 0;
+       *_n = 0;
        s.l = s.m = 0; s.s = 0;
        fp = gzopen(fn, "r");
+       if (fp == 0) return 0; // fail to open file
        ks = ks_init(fp);
        while (ks_getuntil(ks, 0, &s, &dret) >= 0) {
                if (max == n) {