Fix bug with files that are multiples of 1024.

This commit is contained in:
Markus Birth 2018-10-15 00:26:23 +02:00
parent 465cbde339
commit c859cd88dc
Signed by: mbirth
GPG Key ID: A9928D7A098C3A9A

View File

@ -20,9 +20,9 @@ with open(FILE, "rb") as f:
csum_pre = csum
csum += c
csum &= 0xff
last_byte = c
if len(block) < 1024:
print("End reached.")
last_byte = unpack("B", block[-1:])[0]
break
print("Sum of all bytes: {:02x}".format(csum))