Skip to content

Commit 001fdda

Browse files
authored
fix out of memory read/writes that silently worked on old toolchains (#99)
* fix out of memory read/writes that silently worked on old toolchains * remove errnoeouse fclose
1 parent ef334e8 commit 001fdda

File tree

3 files changed

+2
-2
lines changed

3 files changed

+2
-2
lines changed

arm9/source/graphics/graphics.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,7 @@ void printTextTinted(const std::u16string &text, TextColor palette, int xPos, in
541541

542542
int t = getCharIndex(text[c]);
543543
Image image = {tileWidth, tileHeight, {}, {}, 0};
544+
image.bitmap.resize(tileSize * 4);
544545
for(int i = 0; i < tileSize; i++) {
545546
image.bitmap[(i * 4)] = (fontTiles[i + (t * tileSize)] >> 6 & 3);
546547
image.bitmap[(i * 4) + 1] = (fontTiles[i + (t * tileSize)] >> 4 & 3);

arm9/source/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ void init(int argc, char **argv) {
9292
}
9393
}
9494

95-
wideScreen = (strcmp(argv[1], "wide") == 0) || keysDown() & KEY_Y;
95+
wideScreen = (argc > 1 && strcmp(argv[1], "wide") == 0) || keysDown() & KEY_Y;
9696

9797
loadLoadingLogo();
9898
showLoadingLogo();

arm9/source/utils/bank/banks.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ bool Banks::saveJson()
8181
}
8282
else
8383
{
84-
fclose(out);
8584
return false;
8685
}
8786
}

0 commit comments

Comments
 (0)