From d4dc1570eeb643571de66fa4be5b09b37e90c8cc Mon Sep 17 00:00:00 2001 From: Leonardo Florez-Valencia Date: Wed, 29 Apr 2015 18:13:32 -0500 Subject: [PATCH] Minor modif --- .../Algorithms/IterativeGaussianModelEstimator.hxx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/cpPlugins/Extensions/Algorithms/IterativeGaussianModelEstimator.hxx b/lib/cpPlugins/Extensions/Algorithms/IterativeGaussianModelEstimator.hxx index a8006a0..b0d0505 100644 --- a/lib/cpPlugins/Extensions/Algorithms/IterativeGaussianModelEstimator.hxx +++ b/lib/cpPlugins/Extensions/Algorithms/IterativeGaussianModelEstimator.hxx @@ -233,10 +233,14 @@ AddSample( const S& s_x, const S& s_y, ... ) std::va_list args_lst; va_start( args_lst, s_y ); sample[ 0 ] = s_x; - sample[ 1 ] = s_y; - for( unsigned int d = 2; d < D; ++d ) - sample[ d ] = S( va_arg( args_lst, double ) ); - va_end( args_lst ); + if( D > 1 ) + { + sample[ 1 ] = s_y; + for( unsigned int d = 2; d < D; ++d ) + sample[ d ] = S( va_arg( args_lst, double ) ); + va_end( args_lst ); + + } // fi this->AddSample( sample ); } -- 2.47.1