SDL_ttf: Don't fail if passed multiple newlines as text (7da9d)

From 7da9d2aac7bf216d6349cb423401c436672970d3 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Mon, 15 Jan 2024 12:08:24 -0800
Subject: [PATCH] Don't fail if passed multiple newlines as text

Fixes https://github.com/libsdl-org/SDL_ttf/issues/311

(cherry picked from commit 2089f482c81decf402cc0fe6c2887195ed9dff43)
---
 src/SDL_ttf.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/SDL_ttf.c b/src/SDL_ttf.c
index cd73d1b..d81fd0a 100644
--- a/src/SDL_ttf.c
+++ b/src/SDL_ttf.c
@@ -3844,6 +3844,8 @@ static SDL_Surface* TTF_Render_Wrapped_Internal(TTF_Font *font, const char *text
                     }
                 }
             }
+            /* In case there are all newlines */
+            width = SDL_max(width, 1);
         }
     } else {
         if (numLines <= 1 && font->horizontal_align == TTF_WRAPPED_ALIGN_LEFT) {