Prevent unilialized precision for cvtStringToDouble

This commit is contained in:
Marty Kraimer
1996-06-11 19:51:14 +00:00
parent e52d0e0929
commit 49173bcb97
2 changed files with 2 additions and 0 deletions

View File

@@ -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 {

View File

@@ -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 {