Skip to content

Commit b64ebe7

Browse files
committed
Revert a bug introduced by PR #2533
As explained by #2533 (comment) the original code was correct
1 parent 0039c20 commit b64ebe7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

regidx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ int regidx_overlap(regidx_t *regidx, const char *chr, uint32_t beg, uint32_t end
442442
if ( !i )
443443
{
444444
int iend = iBIN(end);
445-
if ( iend >= list->nidx ) iend = list->nidx - 1;
445+
if ( iend > list->nidx ) iend = list->nidx; // NB: this is correct, nidx+1 items were allocated
446446
for (i=ibeg; i<=iend; i++)
447447
if ( list->idx[i] ) break;
448448
if ( i>iend ) return 0;

0 commit comments

Comments
 (0)