diff --git a/src/jrd/tra.cpp b/src/jrd/tra.cpp index d455b0792b..9e7773e676 100644 --- a/src/jrd/tra.cpp +++ b/src/jrd/tra.cpp @@ -569,7 +569,7 @@ void TRA_get_inventory(thread_db* tdbb, UCHAR* bit_vector, TraNumber base, TraNu { ULONG l = base % trans_per_tip; const UCHAR* q = tip->tip_transactions + TRANS_OFFSET(l); - l = TRANS_OFFSET(MIN((top + TRA_MASK - base), trans_per_tip - l)); + l = TRANS_OFFSET(MIN((top + TRA_MASK + 1 - base), trans_per_tip - l)); memcpy(p, q, l); p += l; } @@ -588,7 +588,7 @@ void TRA_get_inventory(thread_db* tdbb, UCHAR* bit_vector, TraNumber base, TraNu TPC_update_cache(tdbb, tip, sequence - 1); if (p) { - const ULONG l = TRANS_OFFSET(MIN((top + TRA_MASK - base), trans_per_tip)); + const ULONG l = TRANS_OFFSET(MIN((top + TRA_MASK + 1 - base), trans_per_tip)); memcpy(p, tip->tip_transactions, l); p += l; }