From 174701561fe30db70e1eb2031b6ffe2958248d1d Mon Sep 17 00:00:00 2001 From: saulfabreg Wii VC Project Date: Sat, 4 Nov 2023 14:01:42 -0500 Subject: [PATCH] Revert "Further fixing copying name from ROM header. (Extrems)" This reverts commit 4423addacb380b84c91b3bc09b5ae0b7e9781b93. --- main/rom_gc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main/rom_gc.c b/main/rom_gc.c index 6747cca..6af054f 100644 --- a/main/rom_gc.c +++ b/main/rom_gc.c @@ -181,10 +181,10 @@ int rom_read(fileBrowser_file* file){ // Swap country code back since I know the emulator relies on this being little endian. ROM_HEADER.Country_code = bswap16(ROM_HEADER.Country_code); //Copy header name as Goodname (in the .ini we can use CRC to identify ROMS) - memcpy(ROM_SETTINGS.goodname, ROM_HEADER.Name, 20); - ROM_SETTINGS.goodname[20] = '\0'; + memset((char*)buffer,0,1024); + strncpy(buffer, (char*)ROM_HEADER.Name,20); //Maximum ROM name is 20 bytes. Lets make sure we cut off trailing spaces - for(i = strlen(ROM_SETTINGS.goodname); i>0; i--) + for(i = strlen(buffer); i>0; i--) { if(buffer[i-1] != ' ') { strncpy(&ROM_SETTINGS.goodname[0],&buffer[0],i);