0024971: Incomplete interface of NCollection classes
[occt.git] / src / NCollection / NCollection_BaseVector.hxx
index e0fc574..eefdd2a 100755 (executable)
@@ -177,7 +177,7 @@ protected: //! @name protected methods
     myIncrement  (theOther.myIncrement),
     myLength     (theOther.myLength),
     myCapacity   (GetCapacity(myIncrement) + theOther.myLength / theOther.myIncrement),
-    myNBlocks    (1 + (theOther.myLength - 1)/theOther.myIncrement),
+    myNBlocks    (theOther.myLength == 0 ? 0 : 1 + (theOther.myLength - 1)/theOther.myIncrement),
     myInitBlocks (theInitBlocks)
   {
     myAllocator = (theAllocator.IsNull() ? NCollection_BaseAllocator::CommonBaseAllocator() : theAllocator);