Skip to content

Commit 2fb27c4

Browse files
lagartoxagijzelaerr
authored andcommitted
set_int was just adding data to the array, movingeverything else. Now set_int is overriding the array data correctly (#96)
1 parent 5196f76 commit 2fb27c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

snap7/util.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def set_int(_bytearray, byte_index, _int):
135135
# make sure were dealing with an int
136136
_int = int(_int)
137137
_bytes = struct.unpack('2B', struct.pack('>h', _int))
138-
_bytearray[byte_index:2] = _bytes
138+
_bytearray[byte_index:byte_index + 2] = _bytes
139139

140140

141141
def get_int(_bytearray, byte_index):

0 commit comments

Comments
 (0)