diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2022-07-02 04:50:50 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2022-07-02 04:50:50 +0200 |
| commit | 3bc4b6f9963c7678ade6796729567161c419f0da (patch) | |
| tree | 015894f9ee9b3ea1425505ad81cfc2887542be2a /src | |
| parent | c0bdd53c9074d8606cba64c42059b23d6f840cb9 (diff) | |
| download | jancity-3bc4b6f9963c7678ade6796729567161c419f0da.tar.gz | |
font.c: set null dimensions on null str
Diffstat (limited to 'src')
| -rw-r--r-- | src/font/src/font.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/font/src/font.c b/src/font/src/font.c index 1e1bb6c..ab6865a 100644 --- a/src/font/src/font.c +++ b/src/font/src/font.c @@ -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; |
