diff --git a/src/libCom/cvtFast.c b/src/libCom/cvtFast.c index 9312031b3..bc250042b 100644 --- a/src/libCom/cvtFast.c +++ b/src/libCom/cvtFast.c @@ -151,6 +151,7 @@ int cvtDoubleToString( /* can this routine handle this conversion */ if (precision > 8 || flt_value > 10000000.0 || flt_value < -10000000.0) { if (precision > 8 || flt_value > 1e16 || flt_value < -1e16) { + if(precision>17) precision=17; sprintf(pstr_value,"%*.*e\0",precision+7,precision, flt_value); } else { diff --git a/src/libCom/cvtFast/cvtFast.c b/src/libCom/cvtFast/cvtFast.c index 9312031b3..bc250042b 100644 --- a/src/libCom/cvtFast/cvtFast.c +++ b/src/libCom/cvtFast/cvtFast.c @@ -151,6 +151,7 @@ int cvtDoubleToString( /* can this routine handle this conversion */ if (precision > 8 || flt_value > 10000000.0 || flt_value < -10000000.0) { if (precision > 8 || flt_value > 1e16 || flt_value < -1e16) { + if(precision>17) precision=17; sprintf(pstr_value,"%*.*e\0",precision+7,precision, flt_value); } else {