Console: do not index nonexistent character codes

This commit is contained in:
Josh Holtrop 2023-10-21 21:04:18 -04:00
parent e1f38bd5ea
commit 722494af44

View File

@ -125,6 +125,10 @@ struct Console
*/ */
private static void render_char(size_t x, size_t y, char ch) private static void render_char(size_t x, size_t y, char ch)
{ {
if (ch > 127)
{
ch = 0u;
}
const(CharInfo) * ci = &Kfont.chars[ch]; const(CharInfo) * ci = &Kfont.chars[ch];
Fb.blit_alpha_bitmap(x + ci.left, y + ci.top, ci.bitmap, ci.width, ci.height); Fb.blit_alpha_bitmap(x + ci.left, y + ci.top, ci.bitmap, ci.width, ci.height);
} }