From 821c82117acc9ac4f472ac44ae3fb5c472df83e1 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 5 Nov 2018 21:41:12 +0100 Subject: [PATCH] Fix off-by-one in GetStartblockForBank --- main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index b17ba2e..579dd6f 100644 --- a/main.cpp +++ b/main.cpp @@ -676,7 +676,7 @@ uchar XbitFlasher::CalculateBlockIndexForOffset(int offset) int XbitFlasher::GetStartblockForBank(int layout, int bank) { int offset = 0; - for(int i=1; i <= bank; i++){ + for(int i=1; i < bank; i++){ offset += GetSizeForBank(layout, i); } return CalculateBlockIndexForOffset(offset);