Skip to content

Commit 53f107d

Browse files
committed
Ensure that string type records are null terminated
This also ensures that writing more than 39 characters to a string record will fail with a "string too long" error.
1 parent 32929bd commit 53f107d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

softioc/device.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ def _value_to_epics(self, value):
267267
# Value being written must be a string, and will be automatically null
268268
# terminated where possible.
269269
result = self._ctype_()
270-
result.value = value.encode()
270+
result.value = value.encode() + b'\0'
271271
return result
272272

273273
def _epics_to_value(self, epics):

0 commit comments

Comments
 (0)