From 50da6b9da7930fe378ed64ee9fa4a40de9510d6f Mon Sep 17 00:00:00 2001 From: Vincent Pelletier Date: Tue, 25 Oct 2022 15:31:25 +0000 Subject: [PATCH] Cart_Reader.ino: Assorted cosmetic changes to compareCRC. Shorten gamename to the number of bytes actually used in the code, more sizeof() use. --- Cart_Reader/Cart_Reader.ino | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cart_Reader/Cart_Reader.ino b/Cart_Reader/Cart_Reader.ino index 371006e..0ad5bb4 100644 --- a/Cart_Reader/Cart_Reader.ino +++ b/Cart_Reader/Cart_Reader.ino @@ -636,7 +636,7 @@ boolean compareCRC(char* database, char* crcString, boolean renamerom, int offse display_Update(); //Search for CRC32 in file - char gamename[100]; + char gamename[96]; char crc_search[9]; //go to root @@ -645,8 +645,8 @@ boolean compareCRC(char* database, char* crcString, boolean renamerom, int offse //Search for same CRC in list while (myFile.available()) { //Read 2 lines (game name and CRC) - get_line(gamename, &myFile, 96); - get_line(crc_search, &myFile, 9); + get_line(gamename, &myFile, sizeof(gamename)); + get_line(crc_search, &myFile, sizeof(crc_search)); skip_line(&myFile); //Skip every 3rd line //if checksum search successful, rename the file and end search