From: eap Date: Thu, 13 Apr 2006 07:17:06 +0000 (+0000) Subject: prevent SIGFPE with "Scale distribution" and "nb segments = 1" X-Git-Tag: T3_2_0b1_pre1~22 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4f9f3d8c7703b5acc12ccb4d2c22271ea8964be5;p=modules%2Fsmesh.git prevent SIGFPE with "Scale distribution" and "nb segments = 1" --- diff --git a/src/StdMeshers/StdMeshers_Regular_1D.cxx b/src/StdMeshers/StdMeshers_Regular_1D.cxx index 5390c0428..28ddd2bdd 100644 --- a/src/StdMeshers/StdMeshers_Regular_1D.cxx +++ b/src/StdMeshers/StdMeshers_Regular_1D.cxx @@ -368,11 +368,14 @@ bool StdMeshers_Regular_1D::computeInternalParameters(const TopoDS_Edge& theEdge else { // Number Of Segments hypothesis + int NbSegm = _ivalue[ NB_SEGMENTS_IND ]; + if ( NbSegm < 1 ) return false; + if ( NbSegm == 1 ) return true; + switch (_ivalue[ DISTR_TYPE_IND ]) { case StdMeshers_NumberOfSegments::DT_Scale: { - int NbSegm = _ivalue[ NB_SEGMENTS_IND ]; double scale = _value[ SCALE_FACTOR_IND ]; if (fabs(scale - 1.0) < Precision::Confusion()) {