diff --git a/src/rendering/twn_text.c b/src/rendering/twn_text.c index c54d57b..71d0676 100644 --- a/src/rendering/twn_text.c +++ b/src/rendering/twn_text.c @@ -253,6 +253,9 @@ void draw_text(const char *string, Vec2 position, int height_px, Color color, co /* the original string might not be around by the time it's used, so copy it */ size_t str_length = SDL_strlen(string) + 1; + if (str_length == 1) + /* empty string */ + return; char *dup_string = string_arena_alloc(&string_arena, str_length); SDL_strlcpy(dup_string, string, str_length);