mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-04 01:40:21 -05:00
font: glyph_for_wchar(): ensure glyph->valid == false, in *all* error cases
This commit is contained in:
parent
3c42691e1b
commit
6fd4f6000b
1 changed files with 6 additions and 4 deletions
10
font.c
10
font.c
|
|
@ -324,6 +324,11 @@ hash_index(wchar_t wc)
|
||||||
static bool
|
static bool
|
||||||
glyph_for_wchar(const struct font *font, wchar_t wc, struct glyph *glyph)
|
glyph_for_wchar(const struct font *font, wchar_t wc, struct glyph *glyph)
|
||||||
{
|
{
|
||||||
|
*glyph = (struct glyph){
|
||||||
|
.wc = wc,
|
||||||
|
.valid = false,
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* LCD filter is per library instance. Thus we need to re-set it
|
* LCD filter is per library instance. Thus we need to re-set it
|
||||||
* every time...
|
* every time...
|
||||||
|
|
@ -552,10 +557,7 @@ glyph_for_wchar(const struct font *font, wchar_t wc, struct glyph *glyph)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
err:
|
err:
|
||||||
*glyph = (struct glyph){
|
assert(!glyph->valid);
|
||||||
.wc = wc,
|
|
||||||
.valid = false,
|
|
||||||
};
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue