]> git.donarmstrong.com Git - samtools.git/blobdiff - bam_sort.c
* samtools-0.1.2-1
[samtools.git] / bam_sort.c
index c5ed5835b0c26cb4e3ed0a756af26ee8f6d76ef6..f089cdff396695c0cf43d21d09be695463e187c9 100644 (file)
@@ -115,7 +115,7 @@ int bam_merge(int argc, char *argv[])
                case 'n': is_by_qname = 1; break;
                }
        }
-       if (optind + 3 >= argc) {
+       if (optind + 2 >= argc) {
                fprintf(stderr, "Usage: samtools merge [-n] <out.bam> <in1.bam> <in2.bam> [...]\n");
                return 1;
        }
@@ -191,7 +191,7 @@ void bam_sort_core(int is_by_qname, const char *fn, const char *prefix, size_t m
                        fns[i] = (char*)calloc(strlen(prefix) + 20, 1);
                        sprintf(fns[i], "%s.%.4d.bam", prefix, i);
                }
-               bam_merge_core(0, fnout, n, fns);
+               bam_merge_core(is_by_qname, fnout, n, fns);
                free(fnout);
                for (i = 0; i < n; ++i) {
                        unlink(fns[i]);