Skip to content

Commit

Permalink
Merge pull request #196 from NINI1988/fix/lowLevelEnumerateUnits
Browse files Browse the repository at this point in the history
Fix: string buffer too short
  • Loading branch information
hmaarrfk authored Jan 30, 2024
2 parents 08d7afc + 846dff5 commit 4d4cd86
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions picoscope/ps4000a.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,11 @@ def _lowLevelEnumerateUnits(self):
m = self.lib.ps4000aEnumerateUnits(byref(count), byref(serials),
byref(serialLth))
self.checkResult(m)
# a serial number is rouhgly 8 characters
# a serial number is rouhgly 10 characters
# an extra character for the comma
# and an extra one for the space after the comma?
# the extra two also work for the null termination
serialLth = c_int16(count.value * (8 + 2))
serialLth = c_int16(count.value * (10 + 2))
serials = create_string_buffer(serialLth.value + 1)

m = self.lib.ps4000aEnumerateUnits(byref(count), serials,
Expand Down

0 comments on commit 4d4cd86

Please sign in to comment.