Uploading samtools_0.1.17-1_amd64.changes.
[samtools.git] / bedidx.c
index 722877dcc2aa1d414460c328e6e022a22befecfe..34f0f2fb3ba0e40aaab31e4c8eca4140e4a5d458 100644 (file)
--- a/bedidx.c
+++ b/bedidx.c
@@ -119,8 +119,10 @@ void *bed_read(const char *fn)
                        if (ks_getuntil(ks, 0, str, &dret) > 0 && isdigit(str->s[0])) {
                                beg = atoi(str->s); // begin
                                if (dret != '\n') {
-                                       if (ks_getuntil(ks, 0, str, &dret) > 0 && isdigit(str->s[0]))
+                                       if (ks_getuntil(ks, 0, str, &dret) > 0 && isdigit(str->s[0])) {
                                                end = atoi(str->s); // end
+                                               if (end < beg) end = -1;
+                                       }
                                }
                        }
                }