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 | bebf6d6b5f6190de875e23e5a2ad1d1f304f86c2 (patch) | |
| tree | d63c12d113cf97e70caf3783287a546aed0ca02b /src | |
| parent | 7bc58ab0e6e9349fe3e4d121f772bd74d5a814dc (diff) | |
| download | rts-bebf6d6b5f6190de875e23e5a2ad1d1f304f86c2.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; |
