From bb5b1965c75cd633e0a94d50169ecd23c5d1ed06 Mon Sep 17 00:00:00 2001 From: Caner CANDAN Date: Wed, 18 Aug 2010 17:30:11 +0200 Subject: [PATCH] * eoDetSelect: when the call of howmany() returns 0 it is replaced by 1 --- eo/src/eoDetSelect.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/eo/src/eoDetSelect.h b/eo/src/eoDetSelect.h index 312053cbb..9f7cb8781 100644 --- a/eo/src/eoDetSelect.h +++ b/eo/src/eoDetSelect.h @@ -55,6 +55,12 @@ class eoDetSelect : public eoSelect unsigned int pSize = _source.size(); size_t target = howMany(pSize); + if ( target == 0 ) + { + eo::log << eo::warnings << "Call to a eoHowMany instance returns 0 (target=" << target << ") it will be replaced by 1 to continue." << std::endl; + target = 1; + } + _dest.resize(target); unsigned remain = target % pSize;