finishing touches

* replace strlen with strnlen
* avoid static variable in getFontInfo
* remove legacy code in drawCharacter (new code works well)

it works for me, let's ship it ;-)
This commit is contained in:
Frank
2025-11-21 17:26:04 +01:00
parent e6676372d8
commit e38c2b32c8
2 changed files with 6 additions and 26 deletions

View File

@@ -31,7 +31,7 @@ typedef struct {
// logic for font selection based on width and height
inline FontInfo_t getFontInfo(unsigned width, unsigned height) {
static FontInfo_t font = {0}; // not sure if this needs to be static - just wanted to be sure that the function return value is not in the stack area (use-after-free).
FontInfo_t font = {0}; // will be returned by value
unsigned pixels = width * height;
switch (pixels) {