Skip to content

Commit fdbaff3

Browse files
committed
Use PV length defined in dbDefs.h and adjust verfiy.c to also use PV_NAME_LENGTH
1 parent 3e40cdd commit fdbaff3

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

asApp/src/save_restore.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@
5151
#define FN_LEN 80 /* filename length */
5252
#define STRING_LEN MAX_STRING_SIZE /* EPICS max length for string PV */
5353
#define STATUS_STR_LEN 300
54-
#define PV_NAME_LEN 256 /* string containing a PV name */
54+
/* PV_NAME_LENGTH was historcially at least 80, so we ensure it is at least that and otherwise use
55+
PVNAME_STRINGSZ from EPICS base dbDefs.h */
56+
#define PV_NAME_LEN ((PVNAME_STRINGSZ > 80) ? (PVNAME_STRINGSZ) : (80)) /* string containing a PV name */
5557
#define MAXSTRING 300
5658

5759
struct restoreFileListItem {

asApp/src/verify.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717

1818
#include "save_restore.h"
1919

20-
#ifndef PVNAME_STRINGSZ
21-
#define PVNAME_STRINGSZ 61 /* includes terminating null */
22-
#endif
2320
#define PEND_TIME 5.0
2421

2522
#define FSMALL 1.e-6
@@ -143,7 +140,7 @@ int do_asVerify_fp(FILE *fp, int verbose, int debug, int write_restore_file, cha
143140
if (debug > 3)
144141
printf("\nasVerify: PVname='%s', value_string[%d]='%s'\n", PVname, (int)strlen(value_string), value_string);
145142
if (n < 2) *value_string = 0;
146-
if (strlen(PVname) >= PVNAME_STRINGSZ) {
143+
if (strlen(PVname) >= PV_NAME_LEN) {
147144
/* Impossible PV name */
148145
if (write_restore_file) fprintf(fr, "#? %s", bp);
149146
continue;

0 commit comments

Comments
 (0)