Skip to content

Commit a727c30

Browse files
committed
Fix regression introduced in release 2-12
This fixes a bug where records with names longer than 40 characters are not correctly handled. Commit c0420e4 added code to truncate all record string fields to 40 characters: this was done because it seems to be very unclear whether EPICS string values are guaranteed to be null terminated. Unfortunately, the same field access code is also used to retrieve the record NAME field. Reverting this part of the commit seems safe enough as we are simply restoring the old long established behaviour.
1 parent 55b33e3 commit a727c30

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

python/softioc/fields.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def __getattr__(self, field):
135135
if field == 'TIME':
136136
return self.__get_time(address)
137137
elif field_type == DBF_STRING:
138-
return decode(string_at(string_at(cast(address, c_char_p), 40)))
138+
return decode(string_at(cast(address, c_char_p)))
139139
elif field_type in [DBF_INLINK, DBF_OUTLINK]:
140140
return decode(cast(address, POINTER(c_char_p))[0])
141141
else:

0 commit comments

Comments
 (0)