From 9dabcebce57bef31796b48dc83df01365bf47335 Mon Sep 17 00:00:00 2001 From: Pk11 Date: Mon, 20 Jun 2022 17:59:01 -0500 Subject: [PATCH] Leave 1 MiB margin for error --- arm9/src/install.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arm9/src/install.c b/arm9/src/install.c index 259b612..6b128c1 100644 --- a/arm9/src/install.c +++ b/arm9/src/install.c @@ -117,7 +117,8 @@ static bool _checkDsiSpace(unsigned long long size, bool systemApp) iprintf("Enough room on DSi?..."); swiWaitForVBlank(); - if ((systemApp ? getDsiRealFree() : getDsiFree()) < size) + //ensure there's at least 1 MiB free, to leave margin for error + if (((systemApp ? getDsiRealFree() : getDsiFree()) < size) || (((systemApp ? getDsiRealFree() : getDsiFree()) - size) < (1 << 20))) { iprintf("\x1B[31m"); //red iprintf("No\n");