Make the long-string buffer for link fields bigger
When representing a link field as a long string (.INP$) we have to pick some size limit for the buffer. Previously this was the max length of a PV name + 12 chars, but with JSON links that's not big enough. This commit sets it to 1KB and defines a macro so it will be easier to change in the future if necessary.
This commit is contained in:
@@ -657,7 +657,7 @@ long dbNameToAddr(const char *pname, DBADDR *paddr)
|
||||
paddr->dbr_field_type = DBR_CHAR;
|
||||
} else if (dbfType >= DBF_INLINK && dbfType <= DBF_FWDLINK) {
|
||||
/* Clients see a char array, but keep original dbfType */
|
||||
paddr->no_elements = PVNAME_STRINGSZ + 12;
|
||||
paddr->no_elements = PVLINK_STRINGSZ;
|
||||
paddr->field_size = 1;
|
||||
paddr->dbr_field_type = DBR_CHAR;
|
||||
} else {
|
||||
|
||||
@@ -531,7 +531,7 @@ dbChannel * dbChannelCreate(const char *name)
|
||||
paddr->dbr_field_type = DBR_CHAR;
|
||||
} else if (dbfType >= DBF_INLINK && dbfType <= DBF_FWDLINK) {
|
||||
/* Clients see a char array, but keep original dbfType */
|
||||
paddr->no_elements = PVNAME_STRINGSZ + 12;
|
||||
paddr->no_elements = PVLINK_STRINGSZ;
|
||||
paddr->field_size = 1;
|
||||
paddr->dbr_field_type = DBR_CHAR;
|
||||
} else {
|
||||
|
||||
@@ -60,6 +60,10 @@
|
||||
#define PVNAME_STRINGSZ 61
|
||||
#define PVNAME_SZ (PVNAME_STRINGSZ - 1)
|
||||
|
||||
/* Buffer size for the string representation of a DBF_*LINK field */
|
||||
#define PVLINK_STRINGSZ 1024
|
||||
|
||||
/* dbAccess enums/menus can have up to this many choices */
|
||||
#define DB_MAX_CHOICES 30
|
||||
|
||||
#endif /* INC_dbDefs_H */
|
||||
|
||||
Reference in New Issue
Block a user