diff --git a/src/sparsevec.c b/src/sparsevec.c index 2d41214..f1726be 100644 --- a/src/sparsevec.c +++ b/src/sparsevec.c @@ -943,6 +943,7 @@ sparsevec_cmp_internal(SparseVector * a, SparseVector * b) return 1; } + /* Check <= dim since indices start at 1 */ if (a->nnz < b->nnz && b->indices[nnz] <= a->dim) return bx[nnz] < 0 ? 1 : -1;