Skip to content

Commit 4d4cd86

Browse files
authored
Merge pull request #196 from NINI1988/fix/lowLevelEnumerateUnits
Fix: string buffer too short
2 parents 08d7afc + 846dff5 commit 4d4cd86

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

picoscope/ps4000a.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,11 +280,11 @@ def _lowLevelEnumerateUnits(self):
280280
m = self.lib.ps4000aEnumerateUnits(byref(count), byref(serials),
281281
byref(serialLth))
282282
self.checkResult(m)
283-
# a serial number is rouhgly 8 characters
283+
# a serial number is rouhgly 10 characters
284284
# an extra character for the comma
285285
# and an extra one for the space after the comma?
286286
# the extra two also work for the null termination
287-
serialLth = c_int16(count.value * (8 + 2))
287+
serialLth = c_int16(count.value * (10 + 2))
288288
serials = create_string_buffer(serialLth.value + 1)
289289

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

0 commit comments

Comments
 (0)