diff --git a/src/OpenFOAM/primitives/VectorSpace/VectorSpaceI.H b/src/OpenFOAM/primitives/VectorSpace/VectorSpaceI.H index 3488217e07..9fb6f3f1dc 100644 --- a/src/OpenFOAM/primitives/VectorSpace/VectorSpaceI.H +++ b/src/OpenFOAM/primitives/VectorSpace/VectorSpaceI.H @@ -239,11 +239,11 @@ inline const Cmpt& VectorSpace:: ConstBlock::operator[] ( - const direction i + const direction d ) const { #ifdef FULLDEBUG - if (i >= Ncmpts) + if (d >= Ncmpts) { FatalErrorInFunction << "index " << d << " out of range" @@ -251,7 +251,7 @@ ConstBlock::operator[] } #endif - return vs_[BStart + i]; + return vs_[BStart + d]; } @@ -269,7 +269,7 @@ ConstBlock::operator() if (i >= Ncmpts) { FatalErrorInFunction - << "index " << d << " out of range" + << "index " << i << " out of range" << abort(FatalError); }