From 5fa3dd0b4c2a1bb39833263879d1c8c2779a8196 Mon Sep 17 00:00:00 2001 From: sorgelig Date: Sun, 29 Dec 2019 23:36:04 +0800 Subject: [PATCH] arcade: skip md5 check if md5 isn't listed. --- support/arcade/romutils.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/support/arcade/romutils.cpp b/support/arcade/romutils.cpp index 4e541d2..b9e0fb3 100644 --- a/support/arcade/romutils.cpp +++ b/support/arcade/romutils.cpp @@ -371,19 +371,22 @@ static int xml_send_rom(XMLEvent evt, const XMLNode* node, SXML_CHAR* text, cons int checksumsame = 1; char *md5 = arc_info->md5; MD5Final(checksum, &arc_info->context); - printf("md5[%s]\n", arc_info->md5); - printf("md5-calc["); - for (int i = 0; i < 16; i++) + if (*md5) { - char hex[10]; - snprintf(hex, 10, "%02x", (unsigned int)checksum[i]); - printf("%02x", (unsigned int)checksum[i]); - if (tolower(md5[0]) != tolower(hex[0]) || tolower(md5[1]) != tolower(hex[1])) { - checksumsame = 0; + printf("md5[%s]\n", arc_info->md5); + printf("md5-calc["); + for (int i = 0; i < 16; i++) + { + char hex[10]; + snprintf(hex, 10, "%02x", (unsigned int)checksum[i]); + printf("%02x", (unsigned int)checksum[i]); + if (tolower(md5[0]) != tolower(hex[0]) || tolower(md5[1]) != tolower(hex[1])) { + checksumsame = 0; + } + md5 += 2; } - md5 += 2; + printf("]\n"); } - printf("]\n"); if (checksumsame == 0) { printf("mismatch\n");