From c859cd88dcf193171a6b7e959e44be2a3619caea Mon Sep 17 00:00:00 2001 From: Markus Birth Date: Mon, 15 Oct 2018 00:26:23 +0200 Subject: [PATCH] Fix bug with files that are multiples of 1024. --- gcksum.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcksum.py b/gcksum.py index 6c4765e..f25d97c 100644 --- a/gcksum.py +++ b/gcksum.py @@ -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))