db: fix dbpf to enum from integer bug

This commit is contained in:
Andrew Johnson
2012-01-27 09:41:37 -06:00
parent 73768aae9a
commit f86cf730e9

View File

@@ -317,7 +317,7 @@ long epicsShareAPI dbpf(const char *pname,const char *pvalue)
if (nameToAddr(pname, &addr)) return -1;
/* For enumerated types must allow for ENUM rather than string*/
/* If entire field is digits then use DBR_ENUM else DBR_STRING*/
if (addr.dbr_field_type == DBR_ENUM && !*pvalue &&
if (addr.dbr_field_type == DBR_ENUM && *pvalue &&
strspn(pvalue,"0123456789") == strlen(pvalue)) {
unsigned short value;