Leave 1 MiB margin for error

This commit is contained in:
Pk11 2022-06-20 17:59:01 -05:00
parent 4894619bda
commit 9dabcebce5

View File

@ -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");