From 59f9ce9ad4d12d316867c883e60381e5ba2c6789 Mon Sep 17 00:00:00 2001 From: RocketRobz Date: Thu, 28 Jan 2021 09:35:26 -0700 Subject: [PATCH] Fix `Failed to dump the ROM` message being shown when dumping trimmed ROM --- arm9/source/dumpOperations.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arm9/source/dumpOperations.cpp b/arm9/source/dumpOperations.cpp index 507a46c..e818c1e 100644 --- a/arm9/source/dumpOperations.cpp +++ b/arm9/source/dumpOperations.cpp @@ -570,7 +570,7 @@ void ndsCardDump(void) { for (u32 i = 0; i < 0x8000; i += 0x200) { cardRead (src+i, copyBuf+i); } - if (fwrite(copyBuf, 1, (currentSize>=0x8000 ? 0x8000 : currentSize), destinationFile) < 0x8000) { + if (fwrite(copyBuf, 1, (currentSize>=0x8000 ? 0x8000 : currentSize), destinationFile) < 1) { dumpFailMsg(); break; } @@ -726,7 +726,7 @@ void gbaCartDump(void) { cmd[1] = i, writeChange(cmd); readChange(); - if (fwrite(GBAROM + (0x1000 >> 1), 0x1000, 1, destinationFile) < 0x1000) { + if (fwrite(GBAROM + (0x1000 >> 1), 0x1000, 1, destinationFile) < 1) { dumpFailMsg(); break; }