X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bedidx.c;h=34f0f2fb3ba0e40aaab31e4c8eca4140e4a5d458;hb=3384f6c6c1642ada4edae9204ca1202672de7d5a;hp=722877dcc2aa1d414460c328e6e022a22befecfe;hpb=4d48006473298b62ee54f13d706f9f2e512e02bd;p=samtools.git 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; + } } } }