ref: f76f5c3583b729c8c78f23ae46ddae9254e8a906
parent: 38578cc34d07a22d435e271c2448f1fe927d5923
author: Rangi <[email protected]>
date: Fri Sep 30 12:55:09 EDT 2022
Fix array size
--- a/tools/stadium.c
+++ b/tools/stadium.c
@@ -123,7 +123,7 @@
void calculate_checksums(uint8_t *file, bool european) {
// Initialize the CRC table
- for (uint16_t i = 0; i < sizeof(crc_table); i++) {
+ for (uint16_t i = 0; i < sizeof(crc_table) / sizeof(*crc_table); i++) {
uint16_t rem = 0;
for (uint16_t y = 0, c = i; y < 8; y++, c >>= 1) {
rem = (rem >> 1) ^ ((rem ^ c) & 1 ? CRC_POLY : 0);