From af1db2071e0c29b3586309b674ab7389a69da24d Mon Sep 17 00:00:00 2001 From: Caveh Jalali Date: Wed, 9 Feb 2022 00:28:18 -0800 Subject: [PATCH] Fix array indexing in Condense() This fixes intermittent flash verify failures. The wrong array index was used to accumulate the list of blocks that need to be programmed after erase, leaving flash corrupted. --- project.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project.c b/project.c index 568983a..22846b0 100755 --- a/project.c +++ b/project.c @@ -707,7 +707,7 @@ size_t Condense(uintptr_t* out, unsigned char* vc, uintptr_t* addrs, size_t addr for (j = 0; j < addrSize; j++) { for (i = addrs[j] - baseAddr; i < (addrs[j] - baseAddr + step); i++) { if (vc[i] != 0xFF) { - out[j] = addrs[j]; + out[outSize] = addrs[j]; outSize++; break; }