font.c: set null dimensions on null str

This commit is contained in:
Xavier Del Campo Romero 2022-07-02 04:50:50 +02:00
parent 7bc58ab0e6
commit bebf6d6b5f
1 changed files with 11 additions and 0 deletions

View File

@ -9,6 +9,17 @@ static int renderstr(const enum font f, const short x, short y,
const char *str, const bool render, short *const max_x,
short *const max_y)
{
if (!str)
{
if (max_x)
*max_x = 0;
if (max_y)
*max_y = 0;
return 0;
}
static const struct cfg
{
const struct sprite *s;