From 9ef55237f8063efc4e46184157a644c35f72f694 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 19 Oct 2024 13:01:15 -0700 Subject: [PATCH] Don't trim whitespace on the last line of text. Fixes https://github.com/libsdl-org/SDL_ttf/issues/414 --- src/SDL_ttf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SDL_ttf.c b/src/SDL_ttf.c index 8ffe7f55..4add63b2 100644 --- a/src/SDL_ttf.c +++ b/src/SDL_ttf.c @@ -3475,7 +3475,7 @@ static bool GetWrappedLines(TTF_Font *font, const char *text, size_t length, int if (line->text[line->length - 1] == '\r') { --line->length; } - } else { + } else if (i < (numLines - 1)) { while (line->length > 0 && CharacterIsDelimiter(line->text[line->length - 1])) { --line->length;