X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=samtools.git;a=blobdiff_plain;f=bedidx.c;h=34f0f2fb3ba0e40aaab31e4c8eca4140e4a5d458;hp=722877dcc2aa1d414460c328e6e022a22befecfe;hb=e582623cf8c4778c7dc792318635821d3c494b0d;hpb=8a8212c76299ff302cdd41be704d8e0308bd2b1b diff --git a/bedidx.c b/bedidx.c index 722877d..34f0f2f 100644 --- 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; + } } } }