A link is made a constant if either strtod or strtol eats entire string.

Previously only strtod was used.
This commit is contained in:
Marty Kraimer
2001-09-18 12:52:21 +00:00
parent 5a83c766e8
commit 70d0303f78
+8 -4
View File
@@ -2036,13 +2036,17 @@ long epicsShareAPI dbPutString(DBENTRY *pdbentry,char *pstring)
short ppOpt = 0;
short msOpt = 0;
char *end;
double tempval;
char *enddouble;
double tempdouble;
char *endlong;
long templong;
/* Check first to see if string is a constant*/
/*It is a double if strtod eats entire string*/
/*It is a constant if strtod or strtol eats entire string*/
/*leading and trailing blanks have already been stripped*/
tempval = strtod(pstr,&end);
if(*end == 0) {
tempdouble = strtod(pstr,&enddouble);
templong = strtol(pstr,&endlong,0);
if((*enddouble == 0) || (*endlong == 0)) {
if(plink->type==PV_LINK) dbCvtLinkToConstant(pdbentry);
if((!plink->value.constantStr) ||
((int)strlen(plink->value.constantStr)<(int)strlen(pstr)