Fix crash when font is missing a character

This commit is contained in:
Ryan Steinmetz 2018-07-04 11:59:55 -04:00
parent b0860ceca3
commit abc048e3c4

View File

@ -491,7 +491,13 @@ printstr(const char *str, font_t *font)
}
for (int c = 0; c < strlen(str); c++) {
glyph_t *g = font->glyphs[lookupchar(str[c], font)];
int id = lookupchar(str[c], font);
if (id == -1) {
continue;
}
glyph_t *g = font->glyphs[id];
printrow(g, i);
if (opt.color == COLOR_ANSI) {