Skip to content

Commit 1ebfe8b

Browse files
committed
Use EPICS base definition for PV length.
1 parent 2d9a9be commit 1ebfe8b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

asApp/src/save_restore.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* save_restore.h */
22

3+
#include <dbDefs.h> /* PVNAME_STRINGSZ for PV length*/
34
#include <ellLib.h> /* pass0List, pass1List */
45
#include <initHooks.h>
56
#include "save_restore_common.h"
@@ -51,7 +52,9 @@
5152
#define FN_LEN 80 /* filename length */
5253
#define STRING_LEN MAX_STRING_SIZE /* EPICS max length for string PV */
5354
#define STATUS_STR_LEN 300
54-
#define PV_NAME_LEN 80 /* string containing a PV name */
55+
/* PV_NAME_LENGTH was historcially at least 80, so we ensure it is at least that and otherwise use
56+
PVNAME_STRINGSZ from EPICS base dbDefs.h */
57+
#define PV_NAME_LEN ((PVNAME_STRINGSZ > 80) ? (PVNAME_STRINGSZ) : (80)) /* string containing a PV name */
5558
#define MAXSTRING 300
5659

5760
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)