From 62ddb3f948e92f921c0471ac4199aead108b24fd Mon Sep 17 00:00:00 2001 From: Jordi Inglada <jordi.inglada@cesbio.cnes.fr> Date: Wed, 29 Mar 2017 13:56:39 +0200 Subject: [PATCH] BUG: correct ranges for soil index --- Modules/Radiometry/Simulation/src/otbSoilDataBase.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/Radiometry/Simulation/src/otbSoilDataBase.cxx b/Modules/Radiometry/Simulation/src/otbSoilDataBase.cxx index 8b91083cad..11ba50edb0 100644 --- a/Modules/Radiometry/Simulation/src/otbSoilDataBase.cxx +++ b/Modules/Radiometry/Simulation/src/otbSoilDataBase.cxx @@ -43,10 +43,10 @@ const typename SoilDataBase::SoilDataVector& SoilDataBase::GetDB() const double SoilDataBase::GetReflectance(size_t SoilIndex, WavelenghtType wl) const { - if(SoilIndex<1 || SoilIndex > m_SoilDataVector.size()-1) + if(SoilIndex<1 || SoilIndex > m_SoilDataVector.size()) { std::stringstream errmessg; - errmessg << "Soil index must be > 0 and <= " << m_SoilDataVector.size()+1 <<'\n'; + errmessg << "Soil index must be > 0 and <= " << m_SoilDataVector.size() <<'\n'; throw std::range_error( errmessg.str() ); } // wl not in the set of measured ones -- GitLab